package com.informatica.powercenter.sdk.mapfwk.xml;

import com.informatica.powercenter.sdk.MessageCatalog;
import com.informatica.powercenter.sdk.SDKMessage;
import com.informatica.powercenter.sdk.mapfwk.connection.ConnectionInfo;
import com.informatica.powercenter.sdk.mapfwk.connection.ConnectionProperties;
import com.informatica.powercenter.sdk.mapfwk.connection.SourceTargetType;
import com.informatica.powercenter.sdk.mapfwk.core.ASQTransformation;
import com.informatica.powercenter.sdk.mapfwk.core.CustomField;
import com.informatica.powercenter.sdk.mapfwk.core.DSQTransformation;
import com.informatica.powercenter.sdk.mapfwk.core.DataMaskField;
import com.informatica.powercenter.sdk.mapfwk.core.DataMaskTransformation;
import com.informatica.powercenter.sdk.mapfwk.core.Field;
import com.informatica.powercenter.sdk.mapfwk.core.FieldFormat;
import com.informatica.powercenter.sdk.mapfwk.core.Folder;
import com.informatica.powercenter.sdk.mapfwk.core.GroupSet;
import com.informatica.powercenter.sdk.mapfwk.core.GroupType;
import com.informatica.powercenter.sdk.mapfwk.core.IOutputField;
import com.informatica.powercenter.sdk.mapfwk.core.InitProp;
import com.informatica.powercenter.sdk.mapfwk.core.InputSet;
import com.informatica.powercenter.sdk.mapfwk.core.JoinerField;
import com.informatica.powercenter.sdk.mapfwk.core.LookupField;
import com.informatica.powercenter.sdk.mapfwk.core.MapFwkRetrieveContext;
import com.informatica.powercenter.sdk.mapfwk.core.MappBase;
import com.informatica.powercenter.sdk.mapfwk.core.Mapping;
import com.informatica.powercenter.sdk.mapfwk.core.MappingVariable;
import com.informatica.powercenter.sdk.mapfwk.core.Mapplet;
import com.informatica.powercenter.sdk.mapfwk.core.MappletTransformation;
import com.informatica.powercenter.sdk.mapfwk.core.NormalizerField;
import com.informatica.powercenter.sdk.mapfwk.core.NormalizerRecord;
import com.informatica.powercenter.sdk.mapfwk.core.NormalizerTransformation;
import com.informatica.powercenter.sdk.mapfwk.core.PortDef;
import com.informatica.powercenter.sdk.mapfwk.core.PortType;
import com.informatica.powercenter.sdk.mapfwk.core.RouterField;
import com.informatica.powercenter.sdk.mapfwk.core.RowSet;
import com.informatica.powercenter.sdk.mapfwk.core.SAPASQTransformation;
import com.informatica.powercenter.sdk.mapfwk.core.SAPProgramFlowObject;
import com.informatica.powercenter.sdk.mapfwk.core.Session;
import com.informatica.powercenter.sdk.mapfwk.core.ShortCut;
import com.informatica.powercenter.sdk.mapfwk.core.Source;
import com.informatica.powercenter.sdk.mapfwk.core.SourceTarget;
import com.informatica.powercenter.sdk.mapfwk.core.Table;
import com.informatica.powercenter.sdk.mapfwk.core.Target;
import com.informatica.powercenter.sdk.mapfwk.core.Task;
import com.informatica.powercenter.sdk.mapfwk.core.TaskProperties;
import com.informatica.powercenter.sdk.mapfwk.core.TemplateConstants;
import com.informatica.powercenter.sdk.mapfwk.core.TransformField;
import com.informatica.powercenter.sdk.mapfwk.core.Transformation;
import com.informatica.powercenter.sdk.mapfwk.core.TransformationContext;
import com.informatica.powercenter.sdk.mapfwk.core.TransformationProperties;
import com.informatica.powercenter.sdk.mapfwk.core.UnconnectedLookup;
import com.informatica.powercenter.sdk.mapfwk.core.UnionField;
import com.informatica.powercenter.sdk.mapfwk.core.VSAMField;
import com.informatica.powercenter.sdk.mapfwk.core.WFProperties;
import com.informatica.powercenter.sdk.mapfwk.core.Workflow;
import com.informatica.powercenter.sdk.mapfwk.core.WorkflowVariable;
import com.informatica.powercenter.sdk.mapfwk.exception.InvalidInputException;
import com.informatica.powercenter.sdk.mapfwk.exception.InvalidTransformationException;
import com.informatica.powercenter.sdk.mapfwk.exception.MapFwkReaderException;
import com.informatica.powercenter.sdk.mapfwk.exception.RepoOperationException;
import com.informatica.powercenter.sdk.mapfwk.exception.UnsupportedSourceException;
import com.informatica.powercenter.sdk.mapfwk.exception.UnsupportedTargetException;
import com.informatica.powercenter.sdk.mapfwk.exception.UnsupportedTransformationException;
import com.informatica.powercenter.sdk.mapfwk.metaextension.MetaExtension;
import com.informatica.powercenter.sdk.mapfwk.plugin.PowerConnectConInfo;
import com.informatica.powercenter.sdk.mapfwk.plugin.PowerConnectSource;
import com.informatica.powercenter.sdk.mapfwk.plugin.PowerConnectTarget;
import com.informatica.powercenter.sdk.mapfwk.repository.Repository;
import com.informatica.powercenter.sdk.mapfwk.util.JMFMessageCatalog;
import com.informatica.powercenter.sdk.mapfwk.util.Logger;
import com.informatica.powercenter.sdk.mapfwk.xml.binding.ASSOCIATEDSOURCEINSTANCE;
import com.informatica.powercenter.sdk.mapfwk.xml.binding.ATTRIBUTE;
import com.informatica.powercenter.sdk.mapfwk.xml.binding.CONFIG;
import com.informatica.powercenter.sdk.mapfwk.xml.binding.CONFIGREFERENCEType;
import com.informatica.powercenter.sdk.mapfwk.xml.binding.CONNECTIONREFERENCE;
import com.informatica.powercenter.sdk.mapfwk.xml.binding.CONNECTOR;
import com.informatica.powercenter.sdk.mapfwk.xml.binding.ERPINFO;
import com.informatica.powercenter.sdk.mapfwk.xml.binding.FLATFILE;
import com.informatica.powercenter.sdk.mapfwk.xml.binding.FOLDER;
import com.informatica.powercenter.sdk.mapfwk.xml.binding.GROUP;
import com.informatica.powercenter.sdk.mapfwk.xml.binding.INITPROP;
import com.informatica.powercenter.sdk.mapfwk.xml.binding.INSTANCE;
import com.informatica.powercenter.sdk.mapfwk.xml.binding.MAPPING;
import com.informatica.powercenter.sdk.mapfwk.xml.binding.MAPPINGVARIABLE;
import com.informatica.powercenter.sdk.mapfwk.xml.binding.MAPPLET;
import com.informatica.powercenter.sdk.mapfwk.xml.binding.METADATAEXTENSION;
import com.informatica.powercenter.sdk.mapfwk.xml.binding.POWERMART;
import com.informatica.powercenter.sdk.mapfwk.xml.binding.REPOSITORY;
import com.informatica.powercenter.sdk.mapfwk.xml.binding.SAPPROGRAMFLOWOBJECT;
import com.informatica.powercenter.sdk.mapfwk.xml.binding.SESSION;
import com.informatica.powercenter.sdk.mapfwk.xml.binding.SESSIONEXTENSION;
import com.informatica.powercenter.sdk.mapfwk.xml.binding.SESSTRANSFORMATIONINST;
import com.informatica.powercenter.sdk.mapfwk.xml.binding.SHORTCUT;
import com.informatica.powercenter.sdk.mapfwk.xml.binding.SOURCE;
import com.informatica.powercenter.sdk.mapfwk.xml.binding.SOURCEFIELD;
import com.informatica.powercenter.sdk.mapfwk.xml.binding.TABLEATTRIBUTE;
import com.informatica.powercenter.sdk.mapfwk.xml.binding.TARGET;
import com.informatica.powercenter.sdk.mapfwk.xml.binding.TARGETFIELD;
import com.informatica.powercenter.sdk.mapfwk.xml.binding.TASK;
import com.informatica.powercenter.sdk.mapfwk.xml.binding.TRANSFORMATION;
import com.informatica.powercenter.sdk.mapfwk.xml.binding.TRANSFORMFIELD;
import com.informatica.powercenter.sdk.mapfwk.xml.binding.WORKFLOW;
import com.informatica.powercenter.sdk.mapfwk.xml.binding.WORKFLOWLINK;
import com.informatica.powercenter.sdk.mapfwk.xml.binding.WORKFLOWVARIABLE;
import com.informatica.powercenter.sdk.mapfwk.xml.binding.impl.CONFIGImpl;
import com.informatica.powercenter.sdk.mapfwk.xml.binding.impl.MAPPINGImpl;
import com.informatica.powercenter.sdk.mapfwk.xml.binding.impl.MAPPLETImpl;
import com.informatica.powercenter.sdk.mapfwk.xml.binding.impl.SESSIONImpl;
import com.informatica.powercenter.sdk.mapfwk.xml.binding.impl.SHORTCUTImpl;
import com.informatica.powercenter.sdk.mapfwk.xml.binding.impl.SOURCEImpl;
import com.informatica.powercenter.sdk.mapfwk.xml.binding.impl.TARGETImpl;
import com.informatica.powercenter.sdk.mapfwk.xml.binding.impl.TRANSFORMATIONImpl;
import com.informatica.powercenter.sdk.mapfwk.xml.binding.impl.TRANSFORMFIELDATTRImpl;
import com.informatica.powercenter.sdk.mapfwk.xml.binding.impl.WORKFLOWImpl;
import java.io.File;
import java.io.PrintStream;
import java.util.ArrayList;
import java.util.Collections;
import java.util.Comparator;
import java.util.Enumeration;
import java.util.HashMap;
import java.util.Iterator;
import java.util.List;
import java.util.ListIterator;
import java.util.Map;
import java.util.Properties;
import java.util.Set;
import javax.xml.bind.JAXBContext;
import javax.xml.bind.JAXBException;
import javax.xml.bind.Unmarshaller;
import org.apache.log4j.Priority;

public class XMLReader
        implements IReader {

    private Logger log = Logger.getLogger(XMLReader.class);
    private static Unmarshaller unmarshaller;
    private List vMappletTransformations = new ArrayList();
    private static MessageCatalog msgCat = JMFMessageCatalog.getMsgCatalog();

    public void retrieveRepo(Repository paramRepository, MapFwkRetrieveContext paramMapFwkRetrieveContext)
            throws MapFwkReaderException, UnsupportedTargetException, UnsupportedSourceException, UnsupportedTransformationException {
        try {
            JAXBContext localJAXBContext = JAXBContext.newInstance("com.informatica.powercenter.sdk.mapfwk.xml.binding");
            unmarshaller = localJAXBContext.createUnmarshaller();
            POWERMART localPOWERMART = (POWERMART) unmarshaller.unmarshal(new File(paramMapFwkRetrieveContext.getFileName()));
            readRepositoryObj(localPOWERMART, paramRepository);
        } catch (JAXBException localJAXBException) {
            System.out.println(msgCat.getMessage("2000_XML_READER_JAXB_ERROR_message", localJAXBException.getMessage()).toString());
            System.out.println(msgCat.getMessage("2001_XML_READER_JAXB_LINKED_ERROR_message", localJAXBException.getLinkedException().getMessage()).toString());
            this.log.logMessage(msgCat.getMessage("2000_XML_READER_JAXB_ERROR_message", localJAXBException.getMessage()).toString(), Priority.DEBUG, localJAXBException);
            throw new MapFwkReaderException(localJAXBException.getMessage());
        } catch (RepoOperationException localRepoOperationException) {
            throw new MapFwkReaderException(msgCat.getMessage("1059_RETRIEVE_REPOSITORY_ERROR_message", localRepoOperationException.getMessage()).toString());
        }
    }

    private void readRepositoryObj(POWERMART paramPOWERMART, Repository paramRepository)
            throws RepoOperationException, UnsupportedTargetException, UnsupportedSourceException, UnsupportedTransformationException {
        List localList1 = paramPOWERMART.getREPOSITORY();
        REPOSITORY localREPOSITORY = (REPOSITORY) localList1.get(0);
        XMLReaderHelper.getRepository(localREPOSITORY, paramRepository);
        List localList2 = localREPOSITORY.getFOLDER();
        ListIterator localListIterator = localList2.listIterator();
        while (localListIterator.hasNext()) {
            FOLDER localFOLDER = (FOLDER) localListIterator.next();
            Folder localFolder = readFolderElement(localFOLDER);
            paramRepository.addFolder(localFolder);
        }
    }

    private Source readSourceElement(SOURCE paramSOURCE)
            throws UnsupportedSourceException { 
        
        Source localSource = XMLReaderHelper.getSource(paramSOURCE);
        localSource.setModified(false);
        ConnectionInfo localConnectionInfo = new ConnectionInfo(SourceTargetType.getLiteralFromStr(paramSOURCE.getDATABASETYPE()));
        Object localObject6;
        Object localObject7;
        if (localConnectionInfo.getConnType() == SourceTargetType.VSAM) {
            Object localObject1 = paramSOURCE.getSOURCEFIELD();
            Object localObject2 = new ArrayList();
            Object localObject3 = new ArrayList();
            Object localObject4 = ((List) localObject1).listIterator();
            while (((ListIterator) localObject4).hasNext()) {
                Object localObject5 = (SOURCEFIELD) ((ListIterator) localObject4).next();
                if (((SOURCEFIELD) localObject5).getFIELDTYPE().equals("GRPITEM")) {
                    localObject6 = XMLReaderHelper.getVsamFields((SOURCEFIELD) localObject5, localSource);
                    localObject7 = XMLReaderHelper.getNormalizerRecords((SOURCEFIELD) localObject5, localSource);
                    NormalizerRecord localNormalizerRecord = new NormalizerRecord(((SOURCEFIELD) localObject5).getNAME(), ((SOURCEFIELD) localObject5).getBUSINESSNAME(), ((SOURCEFIELD) localObject5).getDESCRIPTION(), ((SOURCEFIELD) localObject5).getOCCURS(), (List) localObject7, (List) localObject6);
                    ((List) localObject2).add(localNormalizerRecord);
                } else {
                    ((List) localObject3).add(XMLReaderHelper.createVSAMField((SOURCEFIELD) localObject5, localSource));
                }
            }
            localSource.setNormalizerRecords((List) localObject2);
            localSource.setVSAMFields((List) localObject3);
        } else {
            Object localObject1 = paramSOURCE.getSOURCEFIELD();
            Object localObject2 = ((List) localObject1).listIterator();
            while (((ListIterator) localObject2).hasNext()) {
                Object localObject3 = (SOURCEFIELD) ((ListIterator) localObject2).next();
                Object localObject4 = XMLReaderHelper.getField((SOURCEFIELD) localObject3, localSource);
                setFieldFormat((Field) localObject4, ((SOURCEFIELD) localObject3).getPICTURETEXT());
                localSource.addField((Field) localObject4);
            }
        }
        Object localObject1 = localSource.getConnInfo().getConnProps();
        Object localObject2 = paramSOURCE.getTABLEATTRIBUTE();
        Object localObject3 = ((List) localObject2).listIterator();
        while (((ListIterator) localObject3).hasNext()) {
            Object localObject4 = (TABLEATTRIBUTE) ((ListIterator) localObject3).next();
            ((ConnectionProperties) localObject1).setProperty(((TABLEATTRIBUTE) localObject4).getNAME(), ((TABLEATTRIBUTE) localObject4).getVALUE());
        }
        ((ConnectionProperties) localObject1).setProperty("DBDNAME", paramSOURCE.getDBDNAME());
        ((ConnectionProperties) localObject1).setProperty("OWNERNAME", paramSOURCE.getOWNERNAME());
        Object localObject4 = paramSOURCE.getMETADATAEXTENSION();
        Object localObject5 = ((List) localObject4).listIterator();
        while (((ListIterator) localObject5).hasNext()) {
            localObject6 = (METADATAEXTENSION) ((ListIterator) localObject5).next();
            localObject7 = XMLReaderHelper.getMetaExtension((METADATAEXTENSION) localObject6);
            localSource.addMetaExtension((MetaExtension) localObject7);
        }
        return localSource;
    }

    private Target readTargetElement(TARGET paramTARGET)
            throws UnsupportedTargetException {
        Target localTarget = XMLReaderHelper.getTarget(paramTARGET);
        localTarget.setModified(false);
        List localList = paramTARGET.getTARGETFIELD();
        ListIterator localListIterator1 = localList.listIterator();
        while (localListIterator1.hasNext()) {
            Object localObject1 = (TARGETFIELD) localListIterator1.next();
            Object localObject2 = XMLReaderHelper.getField((TARGETFIELD) localObject1, localTarget);
            setFieldFormat((Field) localObject2, ((TARGETFIELD) localObject1).getPICTURETEXT());
            localTarget.addField((Field) localObject2);
        }
        Object localObject1 = localTarget.getConnInfo().getConnProps();
        Object localObject2 = paramTARGET.getTABLEATTRIBUTE();
        ListIterator localListIterator2 = ((List) localObject2).listIterator();
        while (localListIterator2.hasNext()) {
            Object localObject3 = (TABLEATTRIBUTE) localListIterator2.next();
            ((ConnectionProperties) localObject1).setProperty(((TABLEATTRIBUTE) localObject3).getNAME(), ((TABLEATTRIBUTE) localObject3).getVALUE());
        }
        Object localObject3 = paramTARGET.getMETADATAEXTENSION();
        ListIterator localListIterator3 = ((List) localObject3).listIterator();
        while (localListIterator3.hasNext()) {
            METADATAEXTENSION localMETADATAEXTENSION = (METADATAEXTENSION) localListIterator3.next();
            MetaExtension localMetaExtension = XMLReaderHelper.getMetaExtension(localMETADATAEXTENSION);
            localTarget.addMetaExtension(localMetaExtension);
        }
        return localTarget;
    }

    private void setFieldFormat(Field paramField, String paramString) {
        if ((paramString != "") && (paramField.getDataType().equals("datetime"))) {
            FieldFormat localFieldFormat = new FieldFormat();
            String[] arrayOfString = paramString.split(" ");
            String str = arrayOfString[(arrayOfString.length - 1)];
            if (arrayOfString[0].equals("F")) {
                localFieldFormat.setFixedWidthFlag(true);
                localFieldFormat.setFieldWidthValue(Integer.parseInt(arrayOfString[(arrayOfString.length - 2)]));
            } else if (arrayOfString[0].equals("A")) {
                localFieldFormat.setAdjustWidthFlag(true);
                localFieldFormat.setPadding(Integer.parseInt(arrayOfString[(arrayOfString.length - 2)]) - str.length());
            }
            localFieldFormat.setFormatString(str);
            paramField.setFieldFormat(localFieldFormat);
        }
    }

    private Transformation readTransformationElement(TRANSFORMATION paramTRANSFORMATION)
            throws UnsupportedTransformationException {
        int i = -1;
        if (paramTRANSFORMATION == null) {
            return null;
        }
        ArrayList localArrayList1 = new ArrayList();
        ArrayList localArrayList2 = new ArrayList();
        ArrayList localArrayList3 = new ArrayList();
        ArrayList localArrayList4 = new ArrayList();
        ArrayList localArrayList5 = new ArrayList();
        ArrayList localArrayList6 = new ArrayList();
        RowSet localRowSet1 = new RowSet();
        RowSet localRowSet2 = new RowSet();
        RowSet localRowSet3 = new RowSet();
        String str1 = "";
        ArrayList localArrayList7 = new ArrayList();
        Source localSource = null;
        int j = 0;
        Field localField = null;
        i = XMLHelper.getTransformationType(paramTRANSFORMATION.getTYPE());
        List localList1 = paramTRANSFORMATION.getTRANSFORMFIELD();
        ListIterator localListIterator = localList1.listIterator();
        Object localObject5;
        Object localObject15;
        Object localObject16;
        Object localObject17;
        Object localObject18;
        Object localObject19;
        while (localListIterator.hasNext()) {
            Object localObject1 = (TRANSFORMFIELD) localListIterator.next();
            Object localObject2 = XMLReaderHelper.getField((TRANSFORMFIELD) localObject1);
            Object localObject3 = null;
            switch (i) {
                case 0:
                case 1:
                case 3:
                case 5:
                case 8:
                case 9:
                case 12:
                case 13:
                case 14:
                case 16:
                case 22:
                case 26:
                case 27:
                    Object localObject4 = new TransformField((Field) localObject2, ((TRANSFORMFIELD) localObject1).getEXPRESSION());
                    ((TransformField) localObject4).setPortType(getEnumFromStrPortType(((TRANSFORMFIELD) localObject1).getPORTTYPE()));
                    ((TransformField) localObject4).setExpressionType(((TRANSFORMFIELD) localObject1).getEXPRESSIONTYPE());
                    localObject5 = ((TRANSFORMFIELD) localObject1).getISSORTKEY();
                    Object localObject7 = ((TRANSFORMFIELD) localObject1).getSORTDIRECTION();
                    if ((localObject5 != null) && (((String) localObject5).equalsIgnoreCase("YES"))) {
                        localArrayList5.add(((Field) localObject2).getName());
                        localArrayList6.add(localObject7);
                    }
                    if (((TransformField) localObject4).getExpressionType() != null) {
                        if (((TransformField) localObject4).getExpressionType().equalsIgnoreCase("RANKPORT")) {
                            str1 = ((TransformField) localObject4).getField().getName();
                        } else if (((TransformField) localObject4).getExpressionType().equalsIgnoreCase("GROUPBY")) {
                            localArrayList7.add(((TransformField) localObject4).getField().getName());
                        }
                    }
                    localObject3 = localObject4;
                    break;
                case 7:
                    LookupField localLookupField = new LookupField((Field) localObject2);
                    localLookupField.setPortType(getEnumFromStrPortType(((TRANSFORMFIELD) localObject1).getPORTTYPE()));
                    localObject3 = localLookupField;
                    break;
                case 10:
                    RouterField localRouterField = new RouterField((Field) localObject2, ((TRANSFORMFIELD) localObject1).getGROUP(), getEnumFromStrPortType(((TRANSFORMFIELD) localObject1).getPORTTYPE()), ((TRANSFORMFIELD) localObject1).getREFFIELD());
                    localObject3 = localRouterField;
                    break;
                case 6:
                    Object localObject12 = new JoinerField((Field) localObject2);
                    ((JoinerField) localObject12).setPortType(getEnumFromStrPortType(((TRANSFORMFIELD) localObject1).getPORTTYPE()));
                    ((JoinerField) localObject12).setExpressionType(((TRANSFORMFIELD) localObject1).getEXPRESSIONTYPE());
                    localObject3 = localObject12;
                    break;
                case 2:
                case 23:
                    Object localObject13 = paramTRANSFORMATION.getTEMPLATEID();
                    String str2 = paramTRANSFORMATION.getTEMPLATENAME();
                    if ((localObject13 != null) && (((String) localObject13).equals("303001")) && (str2 != null) && (str2.equalsIgnoreCase("union transformation"))) {
                        i = 15;
                    }
                    if ((localObject13 != null) && (((String) localObject13).equalsIgnoreCase(String.valueOf(TemplateConstants.DATA_MASKING_TEMPLATE_ID))) && (str2 != null) && (str2.equalsIgnoreCase(TemplateConstants.DATA_MASKING_TEMPLATE_NAME))) {
                        i = 28;
                    }
                    if (i == 15) {
                        localObject15 = new UnionField((Field) localObject2, ((TRANSFORMFIELD) localObject1).getGROUP(), getEnumFromStrPortType(((TRANSFORMFIELD) localObject1).getPORTTYPE()));
                        localObject3 = localObject15;
                    } else if (i == 28) {
                        localObject15 = new DataMaskField((Field) localObject2, ((TRANSFORMFIELD) localObject1).getGROUP(), getEnumFromStrPortType(((TRANSFORMFIELD) localObject1).getPORTTYPE()));
                        localObject16 = ((TRANSFORMFIELD) localObject1).getTRANSFORMFIELDATTR();
                        localObject17 = new Properties();
                        localObject18 = ((List) localObject16).iterator();
                        while (((Iterator) localObject18).hasNext()) {
                            localObject19 = (TRANSFORMFIELDATTRImpl) ((Iterator) localObject18).next();
                            ((Properties) localObject17).setProperty(((TRANSFORMFIELDATTRImpl) localObject19).getNAME(), ((TRANSFORMFIELDATTRImpl) localObject19).getVALUE());
                        }
                        ((Field) localObject2).setFieldAttributes((Map) localObject17);
                        localObject3 = localObject15;
                    } else {
                        localObject15 = new CustomField((Field) localObject2, ((TRANSFORMFIELD) localObject1).getGROUP(), getEnumFromStrPortType(((TRANSFORMFIELD) localObject1).getPORTTYPE()));
                        ((CustomField) localObject15).setOutGroupName(((TRANSFORMFIELD) localObject1).getOUTPUTGROUP());
                        if (i == 23) {
                            ((CustomField) localObject15).setGroupName(((TRANSFORMFIELD) localObject1).getMAPPLETGROUP());
                        }
                        localObject3 = localObject15;
                    }
                    break;
                case 4:
                case 11:
                case 15:
                case 17:
                case 18:
                case 19:
                case 20:
                case 21:
                case 24:
                case 25:
            }
            if (localObject3 != null) {
                localArrayList1.add(localObject3);
            }
        }
        Object localObject1 = paramTRANSFORMATION.getGROUP();
        Object localObject2 = ((List) localObject1).listIterator();
        int k = ((List) localObject1).size();
        GroupSet[] localObject4 = new GroupSet[0];
        if ((k > 0) && (i != 10)) {
            localObject4 = new GroupSet[k];
        }
        while (((ListIterator) localObject2).hasNext()) {
            localObject5 = (GROUP) ((ListIterator) localObject2).next();
            if ((((GROUP) localObject5).getEXPRESSION() != null) && (!((GROUP) localObject5).getEXPRESSION().equalsIgnoreCase(""))) {
                Object localObject7 = XMLReaderHelper.getTransformGroup((GROUP) localObject5);
                localArrayList4.add(localObject7);
            } else if (i != 10) {
                GroupSet localObject7 = new GroupSet(((GROUP) localObject5).getNAME(), GroupType.valueOf(((GROUP) localObject5).getTYPE()));
                int n = Integer.parseInt(((GROUP) localObject5).getORDER());
                localObject4[(n - 1)] = localObject7;
            }
        }
        Object localObject10;
        if (localObject4.length != 0) {
            int m;
            RowSet localRowSet4;
            if (i == 15) {
                for (m = 0; m < localObject4.length; m++) {
                    Object localObject7 = localObject4[m];
                    localRowSet4 = new RowSet();
                    for (int i3 = 0; i3 < localArrayList1.size(); i3++) {
                        Object localObject12 = (IOutputField) localArrayList1.get(i3);
                        if (((IOutputField) localObject12).getGroupName().equalsIgnoreCase(((GroupSet) localObject7).getName())) {
                            if (((GroupSet) localObject7).getGroupType() == GroupType.OUTPUT) {
                                localRowSet3.addField(((IOutputField) localObject12).getField());
                            } else {
                                localRowSet4.addField(((IOutputField) localObject12).getField());
                            }
                        }
                    }
                    if (localRowSet4.size() != 0) {
                        InputSet localInputSet = new InputSet(localRowSet4);
                        localInputSet.getOutRowSet().setGroupName(((GroupSet) localObject7).getName());
                        localArrayList2.add(localInputSet);
                    }
                }
            } else if (i == 28) {
                for (m = 0; m < localObject4.length; m++) {
                    Object localObject7 = localObject4[m];
                    localRowSet4 = new RowSet();
                    for (int i4 = 0; i4 < localArrayList1.size(); i4++) {
                        Object localObject12 = (IOutputField) localArrayList1.get(i4);
                        if ((((IOutputField) localObject12).getGroupName().equalsIgnoreCase(((GroupSet) localObject7).getName())) && (((GroupSet) localObject7).getGroupType() != GroupType.OUTPUT)) {
                            localRowSet4.addField(((IOutputField) localObject12).getField());
                        }
                    }
                    if (localRowSet4.size() != 0) {
                        localObject10 = new InputSet(localRowSet4);
                        ((InputSet) localObject10).getOutRowSet().setGroupName(((GroupSet) localObject7).getName());
                        localArrayList2.add(localObject10);
                    }
                }
            } else {
                Object localObject6 = null;
                Object localObject7 = null;
                for (int i1 = 0; i1 < localObject4.length; i1++) {
                    localObject10 = localObject4[i1];
                    Object localObject12 = new ArrayList();
                    Object localObject13 = new RowSet();
                    int i6;
                    if (((GroupSet) localObject10).getGroupType() == GroupType.INPUT) {
                        localObject6 = ((GroupSet) localObject10).getName();
                        for (i6 = 0; i6 < localArrayList1.size(); i6++) {
                            localObject15 = (CustomField) localArrayList1.get(i6);
                            if (((CustomField) localObject15).getGroupName().equalsIgnoreCase(((GroupSet) localObject10).getName())) {
                                if (((CustomField) localObject15).getGroupName().equalsIgnoreCase(((CustomField) localObject15).getOutGroupName())) {
                                    if (((CustomField) localObject15).getPortType() == PortType.INPUT) {
                                        ((List) localObject12).add(((CustomField) localObject15).getField());
                                    } else if (((CustomField) localObject15).getPortType() == PortType.INPUT_OUTPUT) {
                                        ((RowSet) localObject13).addField(((CustomField) localObject15).getField());
                                    }
                                    localObject7 = ((GroupSet) localObject10).getName();
                                } else if ((localObject7 != null) && (((CustomField) localObject15).getOutGroupName().equalsIgnoreCase((String) localObject7))) {
                                    if (((CustomField) localObject15).getPortType() == PortType.INPUT) {
                                        ((List) localObject12).add(((CustomField) localObject15).getField());
                                    } else if (((CustomField) localObject15).getPortType() == PortType.INPUT_OUTPUT) {
                                        ((RowSet) localObject13).addField(((CustomField) localObject15).getField());
                                    }
                                }
                            }
                        }
                    } else {
                        localObject7 = ((GroupSet) localObject10).getName();
                        for (i6 = 0; i6 < localArrayList1.size(); i6++) {
                            localObject15 = (CustomField) localArrayList1.get(i6);
                            if (((CustomField) localObject15).getOutGroupName().equalsIgnoreCase(((GroupSet) localObject10).getName())) {
                                if (((CustomField) localObject15).getGroupName().equalsIgnoreCase(((CustomField) localObject15).getOutGroupName())) {
                                    if (((CustomField) localObject15).getPortType() == PortType.OUTPUT) {
                                        ((List) localObject12).add(((CustomField) localObject15).getField());
                                    } else if (((CustomField) localObject15).getPortType() == PortType.INPUT_OUTPUT) {
                                        ((RowSet) localObject13).addField(((CustomField) localObject15).getField());
                                    }
                                    localObject6 = ((GroupSet) localObject10).getName();
                                } else if ((localObject6 != null) && (((CustomField) localObject15).getGroupName().equalsIgnoreCase((String) localObject6))) {
                                    if (((CustomField) localObject15).getPortType() == PortType.OUTPUT) {
                                        ((List) localObject12).add(((CustomField) localObject15).getField());
                                    } else if (((CustomField) localObject15).getPortType() == PortType.INPUT_OUTPUT) {
                                        ((RowSet) localObject13).addField(((CustomField) localObject15).getField());
                                    }
                                }
                            }
                        }
                    }
                    ((GroupSet) localObject10).setInputSet(new InputSet((RowSet) localObject13));
                    ((GroupSet) localObject10).setOutputFields((List) localObject12);
                    localArrayList2.add(localObject10);
                }
            }
        } else if (localObject4.length == 0) {
            Object localObject6 = localArrayList1.iterator();
            Object localObject8;
            if (i == 23) {
                Object localObject7 = null;
                localObject8 = new RowSet();
                localObject10 = new ArrayList();
                Object localObject12 = null;
                Object localObject13 = null;
                while (((Iterator) localObject6).hasNext()) {
                    localObject13 = (CustomField) ((Iterator) localObject6).next();
                    if (!((CustomField) localObject13).getGroupName().equalsIgnoreCase((String) localObject12)) {
                        if (localObject12 != null) {
                            addGroups((RowSet) localObject8, (List) localObject10, (GroupSet) localObject7, localArrayList2);
                            localObject8 = new RowSet();
                            localObject10 = new ArrayList();
                        }
                        localObject7 = new GroupSet(((CustomField) localObject13).getGroupName(), GroupType.valueOf(((CustomField) localObject13).getPortType().toString()));
                        localObject12 = ((CustomField) localObject13).getGroupName();
                    }
                    if (((CustomField) localObject13).getPortType() == PortType.INPUT) {
                        ((RowSet) localObject8).addField(((CustomField) localObject13).getField());
                    } else if (((CustomField) localObject13).getPortType() == PortType.OUTPUT) {
                        ((List) localObject10).add(((CustomField) localObject13).getField());
                    }
                }
                addGroups((RowSet) localObject8, (List) localObject10, (GroupSet) localObject7, localArrayList2);
            } else {
                while (((Iterator) localObject6).hasNext()) {
                    Object localObject7 = (IOutputField) ((Iterator) localObject6).next();
                    if ((((IOutputField) localObject7).getPortType() == PortType.OUTPUT) || (((IOutputField) localObject7).getPortType() == PortType.LOCAL_VARIABLE) || (((IOutputField) localObject7).getPortType() == PortType.RETURN_OUTPUT)) {
                        if (i == 26) {
                            localRowSet1.addField(((IOutputField) localObject7).getField());
                        } else {
                            localArrayList3.add(localObject7);
                        }
                    }
                    if ((((IOutputField) localObject7).getPortType() == PortType.LOOKUP) || (((IOutputField) localObject7).getPortType() == PortType.LOOKUP_OUTPUT) || (((IOutputField) localObject7).getPortType() == PortType.LOOKUP_RETURN_OUTPUT)) {
                        if (localSource == null) {
                            localObject8 = paramTRANSFORMATION.getTABLEATTRIBUTE();
                            localObject10 = ((List) localObject8).iterator();
                            while (((Iterator) localObject10).hasNext()) {
                                Object localObject12 = (TABLEATTRIBUTE) ((Iterator) localObject10).next();
                                if ((((TABLEATTRIBUTE) localObject12).getNAME().equals("Lookup table name")) && (!((TABLEATTRIBUTE) localObject12).getVALUE().equals(""))) {
                                    localSource = new Source(((TABLEATTRIBUTE) localObject12).getVALUE(), "", "", ((TABLEATTRIBUTE) localObject12).getVALUE(), (ConnectionInfo) null);
                                }
                            }
                        }
                        if (((IOutputField) localObject7).getPortType() == PortType.LOOKUP_RETURN_OUTPUT) {
                            j = 1;
                            localField = ((IOutputField) localObject7).getField();
                            if (localSource != null) {
                                localSource.addField(((IOutputField) localObject7).getField());
                            }
                            localArrayList3.add(localObject7);
                        } else {
                            if (localSource != null) {
                                localSource.addField(((IOutputField) localObject7).getField());
                            }
                            localArrayList3.add(localObject7);
                        }
                    }
                    if ((((IOutputField) localObject7).getPortType() == PortType.INPUT) || (((IOutputField) localObject7).getPortType() == PortType.INPUT_OUTPUT) || (((IOutputField) localObject7).getPortType() == PortType.INPUT_OUTPUT_DETAIL)) {
                        localRowSet1.addField(((IOutputField) localObject7).getField());
                    }
                    if ((((IOutputField) localObject7).getPortType() == PortType.INPUT_MASTER) || (((IOutputField) localObject7).getPortType() == PortType.INPUT_OUTPUT_MASTER)) {
                        localRowSet2.addField(((IOutputField) localObject7).getField());
                    }
                }
                Object localObject7 = new InputSet(localRowSet1);
                localArrayList2.add(localObject7);
                if (localArrayList5.size() != 0) {
                    for (int i2 = 0; i2 < localArrayList5.size(); i2++) {
                        ((InputSet) localObject7).setSorterField(localArrayList5.get(i2).toString(), localArrayList6.get(i2).toString().equalsIgnoreCase("Ascending"));
                    }
                }
                if (!str1.equalsIgnoreCase("")) {
                    ((InputSet) localObject7).setRankPort(str1);
                }
                if (localArrayList7.size() != 0) {
                    String[] localObject9 = new String[localArrayList7.size()];
                    for (int i5 = 0; i5 < localArrayList7.size(); i5++) {
                        localObject9[i5] = localArrayList7.get(i5).toString();
                    }
                    ((InputSet) localObject7).setGroupBy((String[]) localObject9);
                }
            }
        }
        Object localObject6 = new ArrayList();
        Object localObject7 = paramTRANSFORMATION.getMETADATAEXTENSION();
        Object localObject9 = ((List) localObject7).listIterator();
        while (((ListIterator) localObject9).hasNext()) {
            Object localObject11 = (METADATAEXTENSION) ((ListIterator) localObject9).next();
            Object localObject12 = XMLReaderHelper.getMetaExtension((METADATAEXTENSION) localObject11);
            ((List) localObject6).add(localObject12);
        }
        Object localObject11 = paramTRANSFORMATION.getTABLEATTRIBUTE();
        Object localObject12 = ((List) localObject11).listIterator();
        Object localObject13 = new Properties();
        Object localObject20;
        while (((ListIterator) localObject12).hasNext()) {
            Object localObject14 = (TABLEATTRIBUTE) ((ListIterator) localObject12).next();
            localObject15 = ((TABLEATTRIBUTE) localObject14).getNAME();
            localObject16 = ((TABLEATTRIBUTE) localObject14).getVALUE();
            ((Properties) localObject13).put(localObject15, localObject16);
            if ((i == 2) && (((String) localObject15).equalsIgnoreCase("Is Active")) && (((String) localObject16).equalsIgnoreCase("NO"))) {
                i = 20;
            }
            if (localSource != null) {
                if (((String) localObject15).equalsIgnoreCase("Source Type")) {
                    localObject18 = null;
                    if (((String) localObject16).equalsIgnoreCase("Flat File")) {
                        localObject17 = SourceTargetType.Flat_File;
                    } else {
                        localObject17 = SourceTargetType.Relational;
                    }

                    localObject18 = new ConnectionInfo((SourceTargetType) localObject17);
                    if (localObject17 == SourceTargetType.Flat_File) {
                        localObject19 = ((ConnectionInfo) localObject18).getConnProps();
                        localObject20 = (FLATFILE) paramTRANSFORMATION.getFLATFILE();
                        ((ConnectionProperties) localObject19).setProperty("FLATFILE_CODEPAGE", ((FLATFILE) localObject20).getCODEPAGE());
                        ((ConnectionProperties) localObject19).setProperty("FLATFILE_CONSECDELIMITERSASONE", ((FLATFILE) localObject20).getCONSECDELIMITERSASONE());
                        ((ConnectionProperties) localObject19).setProperty("FLATFILE_DELIMETED", ((FLATFILE) localObject20).getDELIMITED());
                        ((ConnectionProperties) localObject19).setProperty("FLATFILE_DELIMTERS", ((FLATFILE) localObject20).getDELIMITERS());
                        ((ConnectionProperties) localObject19).setProperty("FLATFILE_ESCAPE_CHARACTER", ((FLATFILE) localObject20).getESCAPECHARACTER());
                        ((ConnectionProperties) localObject19).setProperty("FLATFILE_KEEPESCAPECHAR", ((FLATFILE) localObject20).getKEEPESCAPECHAR());
                        ((ConnectionProperties) localObject19).setProperty("FLATFILE_LINESEQUENTIAL", ((FLATFILE) localObject20).getLINESEQUENTIAL());
                        ((ConnectionProperties) localObject19).setProperty("FLATFILE_NULL_CHARACTER", ((FLATFILE) localObject20).getNULLCHARACTER());
                        ((ConnectionProperties) localObject19).setProperty("FLATFILE_NULLCHARTYPE", ((FLATFILE) localObject20).getNULLCHARTYPE());
                        ((ConnectionProperties) localObject19).setProperty("FLATFILE_PADBYTES", ((FLATFILE) localObject20).getPADBYTES());
                        ((ConnectionProperties) localObject19).setProperty("FLATFILE_QUOTE_CHARACTER", ((FLATFILE) localObject20).getQUOTECHARACTER());
                        ((ConnectionProperties) localObject19).setProperty("FLATFILE_REPEATABLE", ((FLATFILE) localObject20).getREPEATABLE());
                        ((ConnectionProperties) localObject19).setProperty("FLATFILE_SHIFTSENSITIVEDATA", ((FLATFILE) localObject20).getSHIFTSENSITIVEDATA());
                        ((ConnectionProperties) localObject19).setProperty("FLATFILE_SKIPROWS", ((FLATFILE) localObject20).getSKIPROWS());
                        ((ConnectionProperties) localObject19).setProperty("FLATFILE_STRIPTRAILINGBLANKS", ((FLATFILE) localObject20).getSTRIPTRAILINGBLANKS());
                    }
                    localSource.setConnInfo((ConnectionInfo) localObject18);
                } else if (((String) localObject15).equalsIgnoreCase("Lookup table name")) {
                    localSource.setName((String) localObject16);
                    localSource.setBusinessName((String) localObject16);
                }
            }
        }
        Object localObject14 = new TransformationContext(localArrayList2);
        Transformation localTransformation;
        try {
            if (localRowSet2.size() != 0) {
                localObject15 = new InputSet(localRowSet2);
                ((InputSet) localObject15).setMaster(true);
                localTransformation = ((TransformationContext) localObject14).createTransform(i, paramTRANSFORMATION.getNAME(), (InputSet) localObject15);
            } else if (localRowSet3.size() != 0) {
                localTransformation = ((TransformationContext) localObject14).createTransform(i, paramTRANSFORMATION.getNAME(), localRowSet3);
            } else if (localSource != null) {
                localTransformation = ((TransformationContext) localObject14).createTransform(i, paramTRANSFORMATION.getNAME(), localSource);
            } else {
                localTransformation = ((TransformationContext) localObject14).createTransform(i, paramTRANSFORMATION.getNAME());
            }
            if (i == 28) {
                localTransformation.setTemplateIDAndName(new Integer(TemplateConstants.DATA_MASKING_TEMPLATE_ID), TemplateConstants.DATA_MASKING_TEMPLATE_NAME);
            }
            if (i == 8) {
                ((NormalizerTransformation) localTransformation).setNormalizerPorts(localArrayList1);
                localObject15 = new ArrayList();
                localObject16 = new ArrayList();
                localObject17 = paramTRANSFORMATION.getSOURCEFIELD();
                localObject18 = ((List) localObject17).listIterator();
                while (((ListIterator) localObject18).hasNext()) {
                    localObject19 = (SOURCEFIELD) ((ListIterator) localObject18).next();
                    if (((SOURCEFIELD) localObject19).getFIELDTYPE().equals("GRPITEM")) {
                        XMLReaderHelper.createNormalizerRecords((SOURCEFIELD) localObject19, localTransformation, (List) localObject15);
                    } else {
                        localObject20 = XMLReaderHelper.getField((SOURCEFIELD) localObject19, localTransformation);
                        NormalizerField localNormalizerField = new NormalizerField(((Field) localObject20).getName(), ((Field) localObject20).getBusinessName(), ((Field) localObject20).getDescription(), ((SOURCEFIELD) localObject19).getOCCURS(), (Field) localObject20);
                        ((List) localObject16).add(localNormalizerField);
                    }
                }
                ((NormalizerTransformation) localTransformation).setNormalizerRecords((List) localObject15);
                ((NormalizerTransformation) localTransformation).setNormalizerFields((List) localObject16);
            }
            localObject15 = paramTRANSFORMATION.getINITPROP();
            localObject16 = ((List) localObject15).listIterator();
            while (((ListIterator) localObject16).hasNext()) {
                localObject17 = (INITPROP) ((ListIterator) localObject16).next();
                localObject18 = XMLReaderHelper.getInitProp((INITPROP) localObject17);
                localTransformation.addInitProp((InitProp) localObject18);
            }
            localObject17 = localTransformation.getTransformationProperties();
            if (localObject13 != null) {
                localObject18 = ((Properties) localObject13).keys();
                while (((Enumeration) localObject18).hasMoreElements()) {
                    localObject19 = ((Enumeration) localObject18).nextElement().toString();
                    ((TransformationProperties) localObject17).setProperty((String) localObject19, ((Properties) localObject13).getProperty((String) localObject19));
                }
            }
            localTransformation.setMetaExtensions((List) localObject6);
            if (localArrayList4.size() == 0) {
                for (int i7 = 0; i7 < localArrayList3.size(); i7++) {
                    localTransformation.addField((IOutputField) localArrayList3.get(i7));
                }
            } else {
                localTransformation.setTransformGroups(localArrayList4);
            }
            if (paramTRANSFORMATION.getREUSABLE().equalsIgnoreCase("yes")) {
                localTransformation.setReusable(true);
            } else {
                localTransformation.setReusable(false);
            }
            localTransformation.setModified(false);
            localTransformation.apply();
            List localList2 = localTransformation.getTransContext().getInputSets();
            localObject19 = localList2.iterator();
            while (((Iterator) localObject19).hasNext()) {
                localObject20 = (InputSet) ((Iterator) localObject19).next();
                localTransformation.setFetchedOutputFields(((InputSet) localObject20).getOutputFields());
            }
        } catch (InvalidTransformationException localInvalidTransformationException) {
            localInvalidTransformationException.printStackTrace();
            localTransformation = null;
        }
        return localTransformation;
    }

    private ShortCut readShortCutElement(SHORTCUT paramSHORTCUT) {
        ShortCut localShortCut = XMLReaderHelper.getShortCut(paramSHORTCUT);
        localShortCut.setModified(false);
        return localShortCut;
    }

    private static void addGroups(RowSet paramRowSet, List<Field> paramList, GroupSet paramGroupSet, List paramList1) {
        if (paramRowSet.size() != 0) {
            InputSet localInputSet = new InputSet(paramRowSet);
            paramGroupSet.setInputSet(localInputSet);
        }
        if (paramList.size() != 0) {
            paramGroupSet.setOutputFields(paramList);
        }
        paramList1.add(paramGroupSet);
    }

    private Source getSourceFromFolder(String paramString1, String paramString2, Folder paramFolder)
            throws RepoOperationException {
        List localList = paramFolder.getSources();
        Iterator localIterator = localList.iterator();
        while (localIterator.hasNext()) {
            Source localSource = (Source) localIterator.next();
            if ((localSource.getName().equalsIgnoreCase(paramString1)) && (localSource.getConnInfo().getConnProps().getProperty("DBDNAME").equals(paramString2))) {
                return localSource;
            }
        }
        return null;
    }

    private Target getTargetFromFolder(String paramString, Folder paramFolder)
            throws RepoOperationException {
        List localList = paramFolder.getTargets();
        Iterator localIterator = localList.iterator();
        while (localIterator.hasNext()) {
            Target localTarget = (Target) localIterator.next();
            if (localTarget.getName().equalsIgnoreCase(paramString)) {
                return localTarget;
            }
        }
        return null;
    }

    private Transformation getTransFromFolder(String paramString, Folder paramFolder)
            throws RepoOperationException {
        List localList = paramFolder.getTransformations();
        Iterator localIterator = localList.iterator();
        while (localIterator.hasNext()) {
            Transformation localTransformation = (Transformation) localIterator.next();
            if (localTransformation.getName().equalsIgnoreCase(paramString)) {
                return localTransformation;
            }
        }
        return null;
    }

    private Source getSourceFromMapp(String paramString, MappBase paramMappBase) {
        List localList = paramMappBase.getSources();
        Iterator localIterator = localList.iterator();
        while (localIterator.hasNext()) {
            Source localSource = (Source) localIterator.next();
            if (localSource.getInstanceName().equalsIgnoreCase(paramString)) {
                return localSource;
            }
        }
        return null;
    }

    private Target getTargetFromMapping(String paramString, Mapping paramMapping) {
        List localList = paramMapping.getTargets();
        Iterator localIterator = localList.iterator();
        while (localIterator.hasNext()) {
            Target localTarget = (Target) localIterator.next();
            if (localTarget.getInstanceName().equalsIgnoreCase(paramString)) {
                return localTarget;
            }
        }
        return null;
    }

    private Transformation getTransFromMapp(String paramString, MappBase paramMappBase) {
        List localList = paramMappBase.getTransformations();
        Iterator localIterator = localList.iterator();
        while (localIterator.hasNext()) {
            Transformation localTransformation = (Transformation) localIterator.next();
            String str = localTransformation.getInstanceName() == null ? localTransformation.getName() : localTransformation.getInstanceName();
            if (str.equalsIgnoreCase(paramString)) {
                return localTransformation;
            }
            if (localTransformation.getTransformationType() == 23) {
                MappletTransformation localMappletTransformation = (MappletTransformation) localTransformation;
                Mapplet localMapplet = localMappletTransformation.getMapplet();
                if (localMapplet != null) {
                    localTransformation = getTransFromMapplet(paramString, localMapplet, localTransformation.getInstanceName());
                }
                if (localTransformation != null) {
                    return localTransformation;
                }
            }
        }
        return null;
    }

    private Transformation getTransFromMapplet(String paramString1, Mapplet paramMapplet, String paramString2) {
        List localList = paramMapplet.getTransformations();
        Iterator localIterator = localList.iterator();
        while (localIterator.hasNext()) {
            Transformation localTransformation = (Transformation) localIterator.next();
            String str = localTransformation.getInstanceName() == null ? localTransformation.getName() : localTransformation.getInstanceName();
            str = paramString2 + "." + str;
            if (str.equalsIgnoreCase(paramString1)) {
                return localTransformation;
            }
        }
        return null;
    }

    private Field getFieldFromTable(String paramString, Table paramTable) {
        Object localObject1;
        Object localObject2;
        Object localObject3;
        Object localObject4;
        Object localObject5;
        Field localObject6;
        if ((paramTable instanceof SourceTarget)) {
            if ((paramTable instanceof Source)) {
                localObject1 = (Source) paramTable;
                localObject2 = ((Source) localObject1).getConnInfo();
                if (((ConnectionInfo) localObject2).getConnType() == SourceTargetType.VSAM) {
                    localObject3 = ((Source) localObject1).getVSAMFields();
                    localObject4 = ((List) localObject3).iterator();
                    while (((Iterator) localObject4).hasNext()) {
                        localObject5 = (VSAMField) ((Iterator) localObject4).next();
                        localObject6 = ((VSAMField) localObject5).getField();
                        if (paramString.equals(((Field) localObject6).getName())) {
                            return localObject6;
                        }
                    }
                    localObject5 = ((Source) localObject1).getNormalizerRecords();
                    return getFieldFromRecords(paramString, (List) localObject5);
                }
            }
            localObject1 = (SourceTarget) paramTable;
            localObject2 = ((SourceTarget) localObject1).getFields();
            localObject3 = ((List) localObject2).iterator();
            while (((Iterator) localObject3).hasNext()) {
                localObject4 = (Field) ((Iterator) localObject3).next();
                if (paramString.equals(((Field) localObject4).getName())) {
                    return (Field) localObject4;
                }
            }
        } else {
            localObject1 = (Transformation) paramTable;
            localObject2 = ((Transformation) localObject1).getTransContext().getInputSets();
            localObject3 = ((List) localObject2).iterator();
            while (((Iterator) localObject3).hasNext()) {
                localObject4 = (InputSet) ((Iterator) localObject3).next();
                localObject5 = ((InputSet) localObject4).getInRowSet().getFields();
                Object localObject61 = ((List) localObject5).iterator();
                while (((Iterator) localObject61).hasNext()) {
                    Object localObject7 = (Field) ((Iterator) localObject61).next();
                    if (paramString.equalsIgnoreCase(((Field) localObject7).getName())) {
                        return (Field) localObject7;
                    }
                }
                Object localObject7 = ((InputSet) localObject4).getOutRowSet().getFields();
                Iterator localIterator1 = ((List) localObject7).iterator();
                while (localIterator1.hasNext()) {
                    Object localObject8 = (Field) localIterator1.next();
                    if (paramString.equalsIgnoreCase(((Field) localObject8).getName())) {
                        return (Field) localObject8;
                    }
                }
                Object localObject8 = ((InputSet) localObject4).getOutputFields();
                Iterator localIterator2 = ((List) localObject8).iterator();
                while (localIterator2.hasNext()) {
                    IOutputField localIOutputField = (IOutputField) localIterator2.next();
                    if (paramString.equalsIgnoreCase(localIOutputField.getField().getName())) {
                        return localIOutputField.getField();
                    }
                }
            }
        }
        return null;
    }

    private Field getFieldFromRecords(String paramString, List paramList) {
        if (paramList == null) {
            return null;
        }
        Iterator localIterator1 = paramList.iterator();
        while (localIterator1.hasNext()) {
            NormalizerRecord localNormalizerRecord = (NormalizerRecord) localIterator1.next();
            List localList = localNormalizerRecord.getNormalizerFields();
            Iterator localIterator2 = localList.iterator();
            while (localIterator2.hasNext()) {
                Object localObject = (VSAMField) localIterator2.next();
                Field localField = ((VSAMField) localObject).getField();
                if (paramString.equals(localField.getName())) {
                    return localField;
                }
            }
            Object localObject = getFieldFromRecords(paramString, localNormalizerRecord.getRecords());
            if (localObject != null) {
                return (Field) localObject;
            }
        }
        return null;
    }

    private MappBase readMappElement(Object paramObject, Folder paramFolder)
            throws RepoOperationException, UnsupportedTransformationException {
        Object localObject1 = null;
        if ((paramObject instanceof MAPPING)) {
            localObject1 = XMLReaderHelper.getMapping((MAPPING) paramObject);
        } else if ((paramObject instanceof MAPPLET)) {
            localObject1 = XMLReaderHelper.getMapplet((MAPPLET) paramObject);
        }

        ((MappBase) localObject1).setParentFolder(paramFolder);
        ((MappBase) localObject1).setModified(false);
        List localList1 = null;
        if ((paramObject instanceof MAPPING)) {
            localList1 = ((MAPPING) paramObject).getTRANSFORMATION();
        } else if ((paramObject instanceof MAPPLET)) {
            localList1 = ((MAPPLET) paramObject).getTRANSFORMATION();
        }
        ListIterator localListIterator = localList1.listIterator();
        Object localObject5;
        while (localListIterator.hasNext()) {
            Object localObject2 = (TRANSFORMATION) localListIterator.next();
            Object localObject3 = readTransformationElement((TRANSFORMATION) localObject2);
            Object localObject4 = ((TRANSFORMATION) localObject2).getISVSAMNORMALIZER();
            if ((localObject4 != null) && (((String) localObject4).equals("YES"))) {
                localObject5 = ((TRANSFORMATION) localObject2).getREFSOURCENAME();
                Object localObject6 = (NormalizerTransformation) localObject3;
                ((NormalizerTransformation) localObject6).setRefSourceName((String) localObject5);
            }
            if ((localObject1 instanceof Mapping)) {
                ((MappBase) localObject1).addTransformation((Transformation) localObject3);
            } else if ((localObject1 instanceof Mapplet)) {
                if (!(localObject3 instanceof MappletTransformation)) {
                    ((MappBase) localObject1).addTransformation((Transformation) localObject3);
                } else if (!this.vMappletTransformations.contains(localObject3)) {
                    localObject5 = (MappletTransformation) localObject3;
                    ((MappletTransformation) localObject5).setMapplet((Mapplet) localObject1);
                    this.vMappletTransformations.add(localObject5);
                    if ((paramObject instanceof MAPPLET)) {
                        Object localObject6 = (Mapplet) localObject1;
                        ((Mapplet) localObject6).setMappletTransformation((MappletTransformation) localObject5);
                    }
                }
            }
        }
        Object localObject2 = null;
        if ((paramObject instanceof MAPPING)) {
            localObject2 = ((MAPPING) paramObject).getINSTANCE();
        } else if ((paramObject instanceof MAPPLET)) {
            localObject2 = ((MAPPLET) paramObject).getINSTANCE();
        }

        Object localObject3 = ((List) localObject2).listIterator();
        Object localObject8;
        Object localObject10;
        while (((ListIterator) localObject3).hasNext()) {
            Object localObject4 = (INSTANCE) ((ListIterator) localObject3).next();
            localObject5 = ((INSTANCE) localObject4).getTRANSFORMATIONTYPE();
            if (((String) localObject5).equalsIgnoreCase("Source Definition")) {
                Object localObject6 = getSourceFromFolder(((INSTANCE) localObject4).getTRANSFORMATIONNAME(), ((INSTANCE) localObject4).getDBDNAME(), paramFolder);
                if (localObject6 != null) {
                    Object localObject7 = createSourceInstances((MappBase) localObject1, (Source) localObject6);
                    ((MappBase) localObject1).addSource((Source) localObject7);
                    ((Source) localObject7).setInstanceName(((INSTANCE) localObject4).getNAME());
                }
            } else if ((((String) localObject5).equalsIgnoreCase("Target Definition")) && ((localObject1 instanceof Mapping))) {
                Object localObject6 = getTargetFromFolder(((INSTANCE) localObject4).getTRANSFORMATIONNAME(), paramFolder);
                if (localObject6 != null) {
                    Object localObject7 = createTargetInstances((MappBase) localObject1, (Target) localObject6);
                    ((Mapping) localObject1).addTarget((Target) localObject7);
                    ((Target) localObject7).setInstanceName(((INSTANCE) localObject4).getNAME());
                }
            } else if (((INSTANCE) localObject4).getTRANSFORMATIONTYPE().equalsIgnoreCase("Mapplet")) {
                if ((localObject1 instanceof Mapping)) {
                    Object localObject6 = ((INSTANCE) localObject4).getTRANSFORMATIONNAME();
                    Object localObject7 = this.vMappletTransformations.iterator();
                    while (((Iterator) localObject7).hasNext()) {
                        localObject8 = (MappletTransformation) ((Iterator) localObject7).next();
                        if ((((MappletTransformation) localObject8).getName().equalsIgnoreCase((String) localObject6)) && (localObject8 != null)) {
                            localObject10 = createTransformationInstances((MappBase) localObject1, (Transformation) localObject8);
                            ((Mapping) localObject1).addTransformation((Transformation) localObject10);
                            ((Transformation) localObject10).setInstanceName(((INSTANCE) localObject4).getNAME());
                            break;
                        }
                    }
                }
            } else {
                Object localObject6 = getTransFromFolder(((INSTANCE) localObject4).getTRANSFORMATIONNAME(), paramFolder);
                if (localObject6 != null) {
                    Object localObject7 = createTransformationInstances((MappBase) localObject1, (Transformation) localObject6);
                    ((MappBase) localObject1).addTransformation((Transformation) localObject7);
                    ((Transformation) localObject7).setInstanceName(((INSTANCE) localObject4).getNAME());
                }
            }
        }
        Object localObject11;
        Object localObject12;
        while (((ListIterator) localObject3).hasPrevious()) {
            Object localObject4 = (INSTANCE) ((ListIterator) localObject3).previous();
            localObject5 = ((INSTANCE) localObject4).getTRANSFORMATIONTYPE();
            if ((((String) localObject5).equalsIgnoreCase("Source Qualifier")) || (((String) localObject5).equalsIgnoreCase("Application Source Qualifier")) || (((String) localObject5).equalsIgnoreCase("Normalizer"))) {
                Object localObject6 = getTransFromMapp(((INSTANCE) localObject4).getTRANSFORMATIONNAME(), (MappBase) localObject1);
                Object localObject7 = null;
                if ((localObject6 instanceof NormalizerTransformation)) {
                    localObject8 = (NormalizerTransformation) localObject6;
                    localObject7 = ((NormalizerTransformation) localObject8).getRefSourceName();
                } else {
                    localObject8 = ((INSTANCE) localObject4).getASSOCIATEDSOURCEINSTANCE();
                    localObject10 = (ASSOCIATEDSOURCEINSTANCE) ((List) localObject8).get(0);
                    localObject7 = ((ASSOCIATEDSOURCEINSTANCE) localObject10).getNAME();
                }
                int j = 0;
                if (localObject7 != null) {
                    localObject10 = getSourceFromMapp((String) localObject7, (MappBase) localObject1);
                    if (localObject10 != null) {
                        localObject11 = ((Transformation) localObject6).getTransContext().getInputSets();
                        localObject12 = ((List) localObject11).iterator();
                        while (((Iterator) localObject12).hasNext()) {
                            InputSet localInputSet = (InputSet) ((Iterator) localObject12).next();
                            localInputSet.setSource((Source) localObject10);
                        }
                    }
                    if ((((Source) localObject10).getDatabaseType().equals(SourceTargetType.SAP_R3)) && ((localObject6 instanceof ASQTransformation))) {
                        j = 1;
                    }
                }
                if (j != 0) {
                    localObject10 = new SAPASQTransformation((ASQTransformation) localObject6);
                    localObject11 = getSAPProgramFlowObjects((SAPASQTransformation) localObject10, paramObject);
                    ((SAPASQTransformation) localObject10).setProgramFlowObjects((List) localObject11);
                    ((MappBase) localObject1).getTransformations().remove(localObject6);
                    ((MappBase) localObject1).getTransformations().add((Transformation) localObject10);
                }
            }
        }
        Object localObject4 = null;
        if ((paramObject instanceof MAPPING)) {
            localObject4 = ((MAPPING) paramObject).getCONNECTOR();
        } else if ((paramObject instanceof MAPPLET)) {
            localObject4 = ((MAPPLET) paramObject).getCONNECTOR();
        }

        for (int i = 0; i < ((List) localObject4).size(); i++) {
            Object localObject6 = (CONNECTOR) ((List) localObject4).get(i);
            if ((((CONNECTOR) localObject6).getTOINSTANCETYPE().equalsIgnoreCase("Target Definition")) && ((localObject1 instanceof Mapping))) {
                Object localObject7 = getTargetFromMapping(((CONNECTOR) localObject6).getTOINSTANCE(), (Mapping) localObject1);
                Object localObject9 = getTransFromMapp(((CONNECTOR) localObject6).getFROMINSTANCE(), (MappBase) localObject1);
                localObject10 = new PortDef(getFieldFromTable(((CONNECTOR) localObject6).getFROMFIELD(), (Table) localObject9), ((CONNECTOR) localObject6).getFROMINSTANCE(), XMLHelper.getTransformationType(((CONNECTOR) localObject6).getFROMINSTANCETYPE()), getFieldFromTable(((CONNECTOR) localObject6).getTOFIELD(), (Table) localObject7), ((CONNECTOR) localObject6).getTOINSTANCE(), XMLHelper.getTransformationType(((CONNECTOR) localObject6).getTOINSTANCETYPE()));
                ((Target) localObject7).getPortDefs().add((PortDef)localObject10);
            } else {
                localObject10 = getTransFromMapp(((CONNECTOR) localObject6).getTOINSTANCE(), (MappBase) localObject1);
                Object localObject9;
                if (((CONNECTOR) localObject6).getFROMINSTANCETYPE().equalsIgnoreCase("Source Definition")) {
                    localObject11 = getSourceFromMapp(((CONNECTOR) localObject6).getFROMINSTANCE(), (MappBase) localObject1);
                    Object localObject7 = getFieldFromTable(((CONNECTOR) localObject6).getFROMFIELD(), (Table) localObject11);
                    localObject9 = new PortDef((Field) localObject7, ((CONNECTOR) localObject6).getFROMINSTANCE(), XMLHelper.getTransformationType(((CONNECTOR) localObject6).getFROMINSTANCETYPE()), getFieldFromTable(((CONNECTOR) localObject6).getTOFIELD(), (Table) localObject10), ((CONNECTOR) localObject6).getTOINSTANCE(), XMLHelper.getTransformationType(((CONNECTOR) localObject6).getTOINSTANCETYPE()));
                } else {
                    localObject11 = getTransFromMapp(((CONNECTOR) localObject6).getFROMINSTANCE(), (MappBase) localObject1);
                    Object localObject7 = getFieldFromTable(((CONNECTOR) localObject6).getFROMFIELD(), (Table) localObject11);
                    localObject12 = getFieldFromTable(((CONNECTOR) localObject6).getTOFIELD(), (Table) localObject10);
                    localObject9 = new PortDef((Field) localObject7, ((CONNECTOR) localObject6).getFROMINSTANCE(), XMLHelper.getTransformationType(((CONNECTOR) localObject6).getFROMINSTANCETYPE()), (Field) localObject12, ((CONNECTOR) localObject6).getTOINSTANCE(), XMLHelper.getTransformationType(((CONNECTOR) localObject6).getTOINSTANCETYPE()));
                }
                localObject11 = ((InputSet) ((Transformation) localObject10).getTransContext().getInputSets().get(0)).getPortDefs();
                ((List) localObject11).add(localObject9);
            }
        }
        cleanUpPortDefs((MappBase) localObject1);
        List localList2 = null;
        if ((paramObject instanceof MAPPING)) {
            localList2 = ((MAPPING) paramObject).getMAPPINGVARIABLE();
        } else if ((paramObject instanceof MAPPLET)) {
            localList2 = ((MAPPLET) paramObject).getMAPPINGVARIABLE();
        }
        Object localObject6 = localList2.listIterator();
        while (((ListIterator) localObject6).hasNext()) {
            Object localObject7 = (MAPPINGVARIABLE) ((ListIterator) localObject6).next();
            Object localObject9 = XMLReaderHelper.getMappingVariable((MAPPINGVARIABLE) localObject7);
            ((MappBase) localObject1).addMappingVariable((MappingVariable) localObject9);
        }
        Object localObject7 = null;
        if ((paramObject instanceof MAPPING)) {
            localObject7 = ((MAPPING) paramObject).getMETADATAEXTENSION();
        }        
        if ((paramObject instanceof MAPPLET)) {
            localObject7 = ((MAPPLET) paramObject).getMETADATAEXTENSION();
        }
        
        Object localObject9 = ((List) localObject7).listIterator();
        while (((ListIterator) localObject9).hasNext()) {
            localObject10 = (METADATAEXTENSION) ((ListIterator) localObject9).next();
            localObject11 = XMLReaderHelper.getMetaExtension((METADATAEXTENSION) localObject10);
            ((MappBase) localObject1).addMetaExtension((MetaExtension) localObject11);
        }
        return (MappBase)localObject1;
    }

    private List<SAPProgramFlowObject> getSAPProgramFlowObjects(SAPASQTransformation paramSAPASQTransformation, Object paramObject) {
        ArrayList localArrayList1 = new ArrayList();
        List localList1 = null;
        if ((paramObject instanceof MAPPING)) {
            localList1 = ((MAPPING) paramObject).getERPINFO();
        }
        if ((paramObject instanceof MAPPLET)) {
            localList1 = ((MAPPLET) paramObject).getERPINFO();
        }
        if (localList1.size() > 0) {
            List localList2 = ((ERPINFO) localList1.get(0)).getSAPOUTPUTPORTOrSAPVARIABLEOrSAPPROGRAMFLOWOBJECT();
            ListIterator localListIterator = localList2.listIterator();
            ArrayList localArrayList2 = new ArrayList();
            while (localListIterator.hasNext()) {
                Object localObject = (SAPPROGRAMFLOWOBJECT) localListIterator.next();
                if (((SAPPROGRAMFLOWOBJECT) localObject).getDSQINSTNAME().equalsIgnoreCase(paramSAPASQTransformation.getName())) {
                    localArrayList2.add(localObject);
                }
            }
            Collections.sort(localArrayList2, new Comparator() {
                public int compare(SAPPROGRAMFLOWOBJECT paramAnonymousSAPPROGRAMFLOWOBJECT1, SAPPROGRAMFLOWOBJECT paramAnonymousSAPPROGRAMFLOWOBJECT2) {
                    int i = Integer.parseInt(paramAnonymousSAPPROGRAMFLOWOBJECT1.getORDER());
                    int j = Integer.parseInt(paramAnonymousSAPPROGRAMFLOWOBJECT2.getORDER());
                    return j < i ? 1 : i < j ? -1 : 0;
                }

                @Override
                public int compare(Object o1, Object o2) {
                    throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.
                }
            });
            Object localObject = localArrayList2.iterator();
            while (((Iterator) localObject).hasNext()) {
                SAPPROGRAMFLOWOBJECT localSAPPROGRAMFLOWOBJECT = (SAPPROGRAMFLOWOBJECT) ((Iterator) localObject).next();
                SAPProgramFlowObject localSAPProgramFlowObject = XMLReaderHelper.getSAPProgramFlowObject(paramSAPASQTransformation, localSAPPROGRAMFLOWOBJECT);
                if (localSAPProgramFlowObject != null) {
                    localArrayList1.add(localSAPProgramFlowObject);
                }
            }
        }
        return localArrayList1;
    }

    private Source createSourceInstances(MappBase paramMappBase, Source paramSource) {
        List localList = paramMappBase.getSources();
        int i = 0;
        Object localObject = localList.iterator();
        while (((Iterator) localObject).hasNext()) {
            Source localSource = (Source) ((Iterator) localObject).next();
            if (localSource.checkNameConflict(paramSource)) {
                i++;
                break;
            }
        }
        if (i != 0) {
            localObject = (Source) paramSource.clone();
            return (Source)localObject;
        }
        return paramSource;
    }

    private Target createTargetInstances(MappBase paramMappBase, Target paramTarget) {
        List localList = ((Mapping) paramMappBase).getTargets();
        int i = 0;
        Object localObject = localList.iterator();
        while (((Iterator) localObject).hasNext()) {
            Target localTarget = (Target) ((Iterator) localObject).next();
            if (localTarget.getName().equalsIgnoreCase(paramTarget.getName())) {
                i++;
                break;
            }
        }
        if (i != 0) {
            localObject = (Target) paramTarget.clone();
            return (Target)localObject;
        }
        return paramTarget;
    }

    private Transformation createTransformationInstances(MappBase paramMappBase, Transformation paramTransformation) {
        List localList = paramMappBase.getTransformations();
        int i = 0;
        Object localObject = localList.iterator();
        while (((Iterator) localObject).hasNext()) {
            Transformation localTransformation = (Transformation) ((Iterator) localObject).next();
            if (localTransformation.getName().equalsIgnoreCase(paramTransformation.getName())) {
                i++;
                break;
            }
        }
        if (i != 0) {
            localObject = (Transformation) paramTransformation.clone();
            return (Transformation)localObject;
        }
        return paramTransformation;
    }

    private void cleanUpPortDefs(MappBase paramMappBase) {
        List localList1 = paramMappBase.getTransformations();
        for (int i = 0; i < localList1.size(); i++) {
            Transformation localTransformation = (Transformation) localList1.get(i);
            List localList2 = localTransformation.getTransContext().getInputSets();
            Iterator localIterator = localList2.iterator();
            while (localIterator.hasNext()) {
                InputSet localInputSet = (InputSet) localIterator.next();
                List localList3 = localInputSet.getPortDefs();
                for (int j = 0; j < localList3.size(); j++) {
                    PortDef localPortDef = (PortDef) localList3.get(j);
                    if (localPortDef.getFromInstanceName() == null) {
                        localList3.remove(j--);
                    }
                }
            }
        }
    }

    private Session readSessionElement(SESSION paramSESSION, List paramList1, List paramList2) {
        Session localSession = XMLReaderHelper.getSession(paramSESSION);
        localSession.setModified(false);
        for (int i = 0; i < paramList1.size(); i++) {
            Object localObject1 = (Mapping) paramList1.get(i);
            if (paramSESSION.getMAPPINGNAME().equalsIgnoreCase(((Mapping) localObject1).getName())) {
                localSession.setMapping((Mapping) localObject1);
            }
        }
        List localList1 = paramSESSION.getATTRIBUTE();
        Object localObject1 = localList1.listIterator();
        TaskProperties localTaskProperties = localSession.getProperties();
        while (((ListIterator) localObject1).hasNext()) {
            Object localObject2 = (ATTRIBUTE) ((ListIterator) localObject1).next();
            localTaskProperties.setProperty(((ATTRIBUTE) localObject2).getNAME(), ((ATTRIBUTE) localObject2).getVALUE());
        }
        localTaskProperties.setProperty("Session Sort Order", paramSESSION.getSORTORDER());
        localSession.setTaskInstanceProperty("REUSABLE", paramSESSION.getREUSABLE());
        localSession.setName(paramSESSION.getNAME());
        Object localObject2 = paramSESSION.getCONFIGREFERENCE().getREFOBJECTNAME();
        Object localObject3 = null;
        for (int j = 0; j < paramList2.size(); j++) {
            Object localObject4 = (CONFIG) paramList2.get(j);
            if (((CONFIG) localObject4).getNAME().equalsIgnoreCase((String) localObject2)) {
                localObject3 = localObject4;
                break;
            }
        }
        if (localObject3 != null) {
            List<ATTRIBUTE> localList2 = ((CONFIG)localObject3).getATTRIBUTE();
            Object localObject4 = localList2.listIterator();
            while (((ListIterator) localObject4).hasNext()) {
                Object localObject5 = (ATTRIBUTE) ((ListIterator) localObject4).next();
                localTaskProperties.setProperty(((ATTRIBUTE) localObject5).getNAME(), ((ATTRIBUTE) localObject5).getVALUE());
            }
        }
        List localList2 = paramSESSION.getMETADATAEXTENSION();
        Object localObject4 = localList2.listIterator();
        Object localObject5 = new ArrayList();
        while (((ListIterator) localObject4).hasNext()) {
            Object localObject6 = (METADATAEXTENSION) ((ListIterator) localObject4).next();
            Object localObject7 = XMLReaderHelper.getMetaExtension((METADATAEXTENSION) localObject6);
            ((List) localObject5).add(localObject7);
        }
        localSession.setMetaExtensions((List) localObject5);
        Object localObject6 = paramSESSION.getSESSTRANSFORMATIONINST();
        Object localObject7 = paramSESSION.getSESSIONEXTENSION();
        ListIterator localListIterator = ((List) localObject7).listIterator();
        while (localListIterator.hasNext()) {
            SESSIONEXTENSION localSESSIONEXTENSION = (SESSIONEXTENSION) localListIterator.next();
            Object localObject8 = null;
            ConnectionInfo localConnectionInfo = null;
            ConnectionProperties localConnectionProperties = null;
            String str = null;
            PowerConnectConInfo localPowerConnectConInfo = null;
            Properties localProperties = null;
            Object localObject10;
            Object localObject11;
            Object localObject12;
            Object localObject13;
            Object localObject14;
            Object localObject15;
            Object localObject16;
            for (int k = 0; k < ((List) localObject6).size(); k++) {
                localObject10 = (SESSTRANSFORMATIONINST) ((List) localObject6).get(k);
                if (((SESSTRANSFORMATIONINST) localObject10).getSINSTANCENAME().equalsIgnoreCase(localSESSIONEXTENSION.getSINSTANCENAME())) {
                    str = ((SESSTRANSFORMATIONINST) localObject10).getTRANSFORMATIONNAME();
                }
                localObject11 = ((SESSTRANSFORMATIONINST) localObject10).getTRANSFORMATIONNAME();
                FLATFILE localFLATFILE;
                if (((SESSTRANSFORMATIONINST) localObject10).getTRANSFORMATIONTYPE().equalsIgnoreCase("Source Definition")) {
                    localObject12 = getSourceFromMapp((String) localObject11, localSession.getMapping());
                    if (localObject12 != null) {
                        localObject13 = ((SESSTRANSFORMATIONINST) localObject10).getATTRIBUTE();
                        localObject14 = ((SESSTRANSFORMATIONINST) localObject10).getFLATFILE();
                        localObject15 = ((List) localObject13).iterator();
                        localProperties = new Properties();
                        while (((Iterator) localObject15).hasNext()) {
                            localObject16 = (ATTRIBUTE) ((Iterator) localObject15).next();
                            ((Source) localObject12).setSessionTransformInstanceProperty(((ATTRIBUTE) localObject16).getNAME(), ((ATTRIBUTE) localObject16).getVALUE());
                            localProperties.setProperty(((ATTRIBUTE) localObject16).getNAME(), ((ATTRIBUTE) localObject16).getVALUE());
                        }
                        if ((localObject14 != null) && (!((List) localObject14).isEmpty())) {
                            localObject16 = ((List) localObject14).iterator();
                            if (((Iterator) localObject16).hasNext()) {
                                localFLATFILE = (FLATFILE) ((Iterator) localObject16).next();
                                if (localFLATFILE.getDELIMITERS() != null) {
                                    localProperties.setProperty("FLATFILE_DELIMTERS", localFLATFILE.getDELIMITERS());
                                }
                                if (localFLATFILE.getCODEPAGE() != null) {
                                    localProperties.setProperty("FLATFILE_CODEPAGE", localFLATFILE.getCODEPAGE());
                                }
                                if (localFLATFILE.getCONSECDELIMITERSASONE() != null) {
                                    localProperties.setProperty("FLATFILE_CONSECDELIMITERSASONE", localFLATFILE.getCONSECDELIMITERSASONE());
                                }
                                if (localFLATFILE.getDELIMITED() != null) {
                                    localProperties.setProperty("FLATFILE_DELIMETED", localFLATFILE.getDELIMITED());
                                }
                                if (localFLATFILE.getESCAPECHARACTER() != null) {
                                    localProperties.setProperty("FLATFILE_ESCAPE_CHARACTER", localFLATFILE.getESCAPECHARACTER());
                                }
                                if (localFLATFILE.getKEEPESCAPECHAR() != null) {
                                    localProperties.setProperty("FLATFILE_KEEPESCAPECHAR", localFLATFILE.getKEEPESCAPECHAR());
                                }
                                if (localFLATFILE.getLINESEQUENTIAL() != null) {
                                    localProperties.setProperty("FLATFILE_LINESEQUENTIAL", localFLATFILE.getLINESEQUENTIAL());
                                }
                                if (localFLATFILE.getNULLCHARACTER() != null) {
                                    localProperties.setProperty("FLATFILE_NULL_CHARACTER", localFLATFILE.getNULLCHARACTER());
                                }
                                if (localFLATFILE.getNULLCHARTYPE() != null) {
                                    localProperties.setProperty("FLATFILE_NULLCHARTYPE", localFLATFILE.getNULLCHARTYPE());
                                }
                                if (localFLATFILE.getPADBYTES() != null) {
                                    localProperties.setProperty("FLATFILE_PADBYTES", localFLATFILE.getPADBYTES());
                                }
                                if (localFLATFILE.getQUOTECHARACTER() != null) {
                                    localProperties.setProperty("FLATFILE_QUOTE_CHARACTER", localFLATFILE.getQUOTECHARACTER());
                                }
                                if (localFLATFILE.getREPEATABLE() != null) {
                                    localProperties.setProperty("FLATFILE_REPEATABLE", localFLATFILE.getREPEATABLE());
                                }
                                if (localFLATFILE.getROWDELIMITER() != null) {
                                    localProperties.setProperty("FLATFILE_ROWDELIMITER", localFLATFILE.getROWDELIMITER());
                                }
                                if (localFLATFILE.getSKIPROWS() != null) {
                                    localProperties.setProperty("FLATFILE_SKIPROWS", localFLATFILE.getSKIPROWS());
                                }
                                if (localFLATFILE.getSTRIPTRAILINGBLANKS() != null) {
                                    localProperties.setProperty("FLATFILE_STRIPTRAILINGBLANKS", localFLATFILE.getSTRIPTRAILINGBLANKS());
                                }
                            }
                        }
                        localSession.addSessionTransformInstanceProperties((Table) localObject12, localProperties);
                    }
                } else if (((SESSTRANSFORMATIONINST) localObject10).getTRANSFORMATIONTYPE().equalsIgnoreCase("Target Definition")) {
                    localObject12 = getTargetFromMapping((String) localObject11, localSession.getMapping());
                    if (localObject12 != null) {
                        localObject13 = ((SESSTRANSFORMATIONINST) localObject10).getATTRIBUTE();
                        localObject14 = ((SESSTRANSFORMATIONINST) localObject10).getFLATFILE();
                        localObject15 = ((List) localObject13).iterator();
                        localProperties = new Properties();
                        while (((Iterator) localObject15).hasNext()) {
                            localObject16 = (ATTRIBUTE) ((Iterator) localObject15).next();
                            ((Target) localObject12).setSessionTransformInstanceProperty(((ATTRIBUTE) localObject16).getNAME(), ((ATTRIBUTE) localObject16).getVALUE());
                            localProperties.setProperty(((ATTRIBUTE) localObject16).getNAME(), ((ATTRIBUTE) localObject16).getVALUE());
                        }
                        if ((localObject14 != null) && (!((List) localObject14).isEmpty())) {
                            localObject16 = ((List) localObject14).iterator();
                            if (((Iterator) localObject16).hasNext()) {
                                localFLATFILE = (FLATFILE) ((Iterator) localObject16).next();
                                if (localFLATFILE.getDELIMITERS() != null) {
                                    localProperties.setProperty("FLATFILE_DELIMTERS", localFLATFILE.getDELIMITERS());
                                }
                                if (localFLATFILE.getCODEPAGE() != null) {
                                    localProperties.setProperty("FLATFILE_CODEPAGE", localFLATFILE.getCODEPAGE());
                                }
                                if (localFLATFILE.getCONSECDELIMITERSASONE() != null) {
                                    localProperties.setProperty("FLATFILE_CONSECDELIMITERSASONE", localFLATFILE.getCONSECDELIMITERSASONE());
                                }
                                if (localFLATFILE.getDELIMITED() != null) {
                                    localProperties.setProperty("FLATFILE_DELIMETED", localFLATFILE.getDELIMITED());
                                }
                                if (localFLATFILE.getESCAPECHARACTER() != null) {
                                    localProperties.setProperty("FLATFILE_ESCAPE_CHARACTER", localFLATFILE.getESCAPECHARACTER());
                                }
                                if (localFLATFILE.getKEEPESCAPECHAR() != null) {
                                    localProperties.setProperty("FLATFILE_KEEPESCAPECHAR", localFLATFILE.getKEEPESCAPECHAR());
                                }
                                if (localFLATFILE.getLINESEQUENTIAL() != null) {
                                    localProperties.setProperty("FLATFILE_LINESEQUENTIAL", localFLATFILE.getLINESEQUENTIAL());
                                }
                                if (localFLATFILE.getNULLCHARACTER() != null) {
                                    localProperties.setProperty("FLATFILE_NULL_CHARACTER", localFLATFILE.getNULLCHARACTER());
                                }
                                if (localFLATFILE.getNULLCHARTYPE() != null) {
                                    localProperties.setProperty("FLATFILE_NULLCHARTYPE", localFLATFILE.getNULLCHARTYPE());
                                }
                                if (localFLATFILE.getPADBYTES() != null) {
                                    localProperties.setProperty("FLATFILE_PADBYTES", localFLATFILE.getPADBYTES());
                                }
                                if (localFLATFILE.getQUOTECHARACTER() != null) {
                                    localProperties.setProperty("FLATFILE_QUOTE_CHARACTER", localFLATFILE.getQUOTECHARACTER());
                                }
                                if (localFLATFILE.getREPEATABLE() != null) {
                                    localProperties.setProperty("FLATFILE_REPEATABLE", localFLATFILE.getREPEATABLE());
                                }
                                if (localFLATFILE.getROWDELIMITER() != null) {
                                    localProperties.setProperty("FLATFILE_ROWDELIMITER", localFLATFILE.getROWDELIMITER());
                                }
                                if (localFLATFILE.getSKIPROWS() != null) {
                                    localProperties.setProperty("FLATFILE_SKIPROWS", localFLATFILE.getSKIPROWS());
                                }
                                if (localFLATFILE.getSTRIPTRAILINGBLANKS() != null) {
                                    localProperties.setProperty("FLATFILE_STRIPTRAILINGBLANKS", localFLATFILE.getSTRIPTRAILINGBLANKS());
                                }
                            }
                        }
                        localSession.addSessionTransformInstanceProperties((Table) localObject12, localProperties);
                    }
                } else if (!((SESSTRANSFORMATIONINST) localObject10).getTRANSFORMATIONTYPE().equalsIgnoreCase("UNKNOWN")) {
                    localObject12 = getTransFromMapp((String) localObject11, localSession.getMapping());
                    if (localObject12 != null) {
                        localObject13 = ((SESSTRANSFORMATIONINST) localObject10).getATTRIBUTE();
                        localObject14 = ((List) localObject13).iterator();
                        localProperties = new Properties();
                        while (((Iterator) localObject14).hasNext()) {
                            localObject15 = (ATTRIBUTE) ((Iterator) localObject14).next();
                            ((Transformation) localObject12).setSessionTransformInstanceProperty(((ATTRIBUTE) localObject15).getNAME(), ((ATTRIBUTE) localObject15).getVALUE());
                            localProperties.setProperty(((ATTRIBUTE) localObject15).getNAME(), ((ATTRIBUTE) localObject15).getVALUE());
                        }
                        localSession.addSessionTransformInstanceProperties((Table) localObject12, localProperties);
                    }
                }
            }
            Object localObject9;
            if (localSESSIONEXTENSION.getTRANSFORMATIONTYPE().equalsIgnoreCase("Source Definition")) {
                localObject9 = getSourceFromMapp(str, localSession.getMapping());
                if (localObject9 != null) {
                    localObject8 = localObject9;
                    localConnectionInfo = ((Source) localObject9).getConnInfo();
                    localConnectionProperties = localConnectionInfo.getConnProps();
                    if (((localObject9 instanceof PowerConnectSource)) && ((((Source) localObject9).getConnInfo() instanceof PowerConnectConInfo))) {
                        localPowerConnectConInfo = (PowerConnectConInfo) ((Source) localObject9).getConnInfo();
                    }
                }
            } else if (localSESSIONEXTENSION.getTRANSFORMATIONTYPE().equalsIgnoreCase("Target Definition")) {
                localObject9 = getTargetFromMapping(str, localSession.getMapping());
                localObject8 = localObject9;
                localConnectionInfo = ((Target) localObject9).getConnInfo();
                localConnectionProperties = localConnectionInfo.getConnProps();
                if (((localObject9 instanceof PowerConnectTarget)) && ((((Target) localObject9).getConnInfo() instanceof PowerConnectConInfo))) {
                    localPowerConnectConInfo = (PowerConnectConInfo) ((Target) localObject9).getConnInfo();
                }
            } else if (localSESSIONEXTENSION.getTRANSFORMATIONTYPE().equalsIgnoreCase("Lookup Procedure")) {
                localObject9 = getTransFromMapp(str, localSession.getMapping());
                localObject8 = localObject9;
                localConnectionInfo = ((Transformation) localObject9).getTransContext().getLookupSource().getConnInfo();
                localConnectionProperties = localConnectionInfo.getConnProps();
            } else if (localSESSIONEXTENSION.getTRANSFORMATIONTYPE().equalsIgnoreCase("Lookup Procedure")) {
                localObject9 = (UnconnectedLookup) getTransFromMapp(str, localSession.getMapping());
                localObject8 = localObject9;
                localObject10 = ((UnconnectedLookup) localObject9).getTransContext().getLookupSrcTgt();
                if (localObject10 != null) {
                    localConnectionInfo = ((UnconnectedLookup) localObject9).getTransContext().getLookupSrcTgt().getConnInfo();
                    localConnectionProperties = localConnectionInfo.getConnProps();
                }
            } else if ((localSESSIONEXTENSION.getTRANSFORMATIONTYPE().equalsIgnoreCase("Source Qualifier")) || (localSESSIONEXTENSION.getTRANSFORMATIONTYPE().equalsIgnoreCase("Application Source Qualifier"))) {
                localObject9 = (DSQTransformation) getTransFromMapp(str, localSession.getMapping());
                localObject8 = localObject9;
                localObject10 = ((InputSet) ((DSQTransformation) localObject9).getTransContext().getInputSets().get(0)).getSource();
                localConnectionInfo = ((Source) localObject10).getConnInfo();
                localConnectionProperties = localConnectionInfo.getConnProps();
                if (((localObject10 instanceof PowerConnectSource)) && ((((Source) localObject10).getConnInfo() instanceof PowerConnectConInfo))) {
                    localPowerConnectConInfo = (PowerConnectConInfo) ((Source) localObject10).getConnInfo();
                }
            } else if (localSESSIONEXTENSION.getTRANSFORMATIONTYPE().equalsIgnoreCase("Normalizer")) {
                localObject9 = (NormalizerTransformation) getTransFromMapp(str, localSession.getMapping());
                localObject8 = localObject9;
                localObject10 = ((InputSet) ((NormalizerTransformation) localObject9).getTransContext().getInputSets().get(0)).getSource();
                localConnectionInfo = ((Source) localObject10).getConnInfo();
                localConnectionProperties = localConnectionInfo.getConnProps();
            } else if (localSESSIONEXTENSION.getTRANSFORMATIONTYPE().equalsIgnoreCase("Custom Transformation")) {
                localObject9 = (DataMaskTransformation) getTransFromMapp(str, localSession.getMapping());
                localObject8 = localObject9;
                localConnectionInfo = new ConnectionInfo(SourceTargetType.Unknown);
                localConnectionProperties = new ConnectionProperties();
            }
            try {
                if (localConnectionProperties != null) {
                    localConnectionProperties.setProperty("NAME", localSESSIONEXTENSION.getNAME());
                    localObject9 = localSESSIONEXTENSION.getATTRIBUTE();
                    if (localSESSIONEXTENSION.getTRANSFORMATIONTYPE().equalsIgnoreCase("Custom Transformation")) {
                        localObject10 = new Properties();
                        localObject11 = ((List) localObject9).iterator();
                        while (((Iterator) localObject11).hasNext()) {
                            localObject12 = (ATTRIBUTE) ((Iterator) localObject11).next();
                            ((Properties) localObject10).setProperty(((ATTRIBUTE) localObject12).getNAME(), ((ATTRIBUTE) localObject12).getVALUE());
                        }
                        localSession.addSessionTransformInstanceProperties((Transformation)localObject8, (Properties) localObject10);
                        localObject11 = new ArrayList();
                        localObject12 = localSESSIONEXTENSION.getCONNECTIONREFERENCE();
                        localObject13 = ((List) localObject12).iterator();
                        while (((Iterator) localObject13).hasNext()) {
                            localObject14 = (CONNECTIONREFERENCE) ((Iterator) localObject13).next();
                            localObject15 = new ConnectionInfo(SourceTargetType.getLiteralFromStr(((CONNECTIONREFERENCE) localObject14).getCONNECTIONSUBTYPE()));
                            localObject16 = ((ConnectionInfo) localObject15).getConnProps();
                            if (((CONNECTIONREFERENCE) localObject14).getCONNECTIONNAME() != "") {
                                ((ConnectionProperties) localObject16).setProperty("CONNECTIONNAME", ((CONNECTIONREFERENCE) localObject14).getCONNECTIONNAME());
                            } else if (((CONNECTIONREFERENCE) localObject14).getVARIABLE() != "") {
                                localConnectionInfo.setConnectionVariable(((CONNECTIONREFERENCE) localObject14).getVARIABLE());
                            }
                            ((ConnectionProperties) localObject16).setProperty("CONNECTIONNUMBER", ((CONNECTIONREFERENCE) localObject14).getCONNECTIONNUMBER());
                            ((ConnectionProperties) localObject16).setProperty("CNXREFNAME", ((CONNECTIONREFERENCE) localObject14).getCNXREFNAME());
                            ((List) localObject11).add(localObject15);
                        }
                        localSession.addConnectionInfosObject((Transformation)localObject8, (List) localObject11);
                    } else {
                        localObject10 = ((List) localObject9).iterator();
                        while (((Iterator) localObject10).hasNext()) {
                            localObject11 = (ATTRIBUTE) ((Iterator) localObject10).next();
                            localConnectionProperties.setProperty(((ATTRIBUTE) localObject11).getNAME(), ((ATTRIBUTE) localObject11).getVALUE());
                        }
                        localObject10 = localSESSIONEXTENSION.getCONNECTIONREFERENCE();
                        localObject11 = ((List) localObject10).iterator();
                        while (((Iterator) localObject11).hasNext()) {
                            localObject12 = (CONNECTIONREFERENCE) ((Iterator) localObject11).next();
                            if (((CONNECTIONREFERENCE) localObject12).getCONNECTIONNAME() != "") {
                                localConnectionProperties.setProperty("CONNECTIONNAME", ((CONNECTIONREFERENCE) localObject12).getCONNECTIONNAME());
                            } else if (((CONNECTIONREFERENCE) localObject12).getVARIABLE() != "") {
                                localConnectionInfo.setConnectionVariable(((CONNECTIONREFERENCE) localObject12).getVARIABLE());
                            }
                            localConnectionProperties.setProperty("CONNECTIONNUMBER", ((CONNECTIONREFERENCE) localObject12).getCONNECTIONNUMBER());
                            localConnectionProperties.setProperty("CONNECTIONSUBTYPE", ((CONNECTIONREFERENCE) localObject12).getCONNECTIONSUBTYPE());
                            localConnectionProperties.setProperty("CONNECTIONTYPE", ((CONNECTIONREFERENCE) localObject12).getCONNECTIONTYPE());
                            if (localPowerConnectConInfo != null) {
                                localPowerConnectConInfo.setConnectionSubType(((CONNECTIONREFERENCE) localObject12).getCONNECTIONSUBTYPE());
                            }
                        }
                        if (localConnectionInfo != null) {
                            localSession.addConnectionInfoObject((Transformation)localObject8, (ConnectionInfo) localConnectionInfo.clone());
                        } else if (localPowerConnectConInfo != null) {
                            localSession.addConnectionInfoObject((Transformation)localObject8, (PowerConnectConInfo) localPowerConnectConInfo.clone());
                        }
                    }
                }
            } catch (InvalidInputException localInvalidInputException) {
                this.log.logMessage(localInvalidInputException.getMessage(), Priority.ERROR);
            }
        }
        return localSession;
    }

    private Workflow readWorkflowElement(WORKFLOW paramWORKFLOW, List paramList1, List paramList2)
            throws MapFwkReaderException {
        Workflow localWorkflow = XMLReaderHelper.getWorkflow(paramWORKFLOW);
        localWorkflow.setModified(false);
        List localList1 = paramWORKFLOW.getSESSION();
        ListIterator localListIterator1 = localList1.listIterator();
        while (localListIterator1.hasNext()) {
            Object localObject1 = readSessionElement((SESSION) localListIterator1.next(), paramList1, paramList2);
            localWorkflow.addSession((Session) localObject1);
        }
        Object localObject1 = paramWORKFLOW.getATTRIBUTE();
        ListIterator localListIterator2 = ((List) localObject1).listIterator();
        WFProperties localWFProperties = localWorkflow.getProperties();
        while (localListIterator2.hasNext()) {
            Object localObject2 = (ATTRIBUTE) localListIterator2.next();
            localWFProperties.setProperty(((ATTRIBUTE) localObject2).getNAME(), ((ATTRIBUTE) localObject2).getVALUE());
        }
        Object localObject2 = new ArrayList();
        List localList2 = paramWORKFLOW.getMETADATAEXTENSION();
        ListIterator localListIterator3 = localList2.listIterator();
        while (localListIterator3.hasNext()) {
            Object localObject3 = (METADATAEXTENSION) localListIterator3.next();
            Object localObject4 = XMLReaderHelper.getMetaExtension((METADATAEXTENSION) localObject3);
            ((List) localObject2).add(localObject4);
        }
        localWorkflow.setMetaExtensions((List) localObject2);
        Object localObject3 = paramWORKFLOW.getWORKFLOWVARIABLE();
        Object localObject4 = ((List) localObject3).iterator();
        while (((Iterator) localObject4).hasNext()) {
            Object localObject5 = (WORKFLOWVARIABLE) ((Iterator) localObject4).next();
            if (!((WORKFLOWVARIABLE) localObject5).getUSERDEFINED().equals("NO")) {
                Object localObject6 = XMLReaderHelper.getWorkflowVariable((WORKFLOWVARIABLE) localObject5);
                localWorkflow.addWorkflowVariable((WorkflowVariable) localObject6);
            }
        }
        Object localObject5 = paramWORKFLOW.getTASK();
        Object localObject6 = ((List) localObject5).iterator();
        while (((Iterator) localObject6).hasNext()) {
            Object localObject7 = (TASK) ((Iterator) localObject6).next();
            if (!((TASK) localObject7).getTYPE().equals("Start")) {
                Object localObject8 = XMLReaderHelper.getTask((TASK) localObject7);
                localWorkflow.addTask((Task) localObject8);
            }
        }
        Object localObject7 = paramWORKFLOW.getWORKFLOWLINK();
        Object localObject8 = getConnections((List) localObject7);
        Iterator localIterator1 = ((HashMap) localObject8).keySet().iterator();
        while (localIterator1.hasNext()) {
            String str1 = (String) localIterator1.next();
            List localList3 = (List) ((HashMap) localObject8).get(str1);
            List localList4 = getTasks(localWorkflow, localList3);
            Task localTask1 = getTask(localWorkflow, str1);
            if (localTask1 != null) {
                Iterator localIterator2 = localList4.iterator();
                while (localIterator2.hasNext()) {
                    KeyValuePair localKeyValuePair = (KeyValuePair) localIterator2.next();
                    Task localTask2 = (Task) localKeyValuePair.getKey();
                    String str2 = (String) localKeyValuePair.getValue();
                    localTask1.connectToTask(localTask2, str2);
                }
            }
        }
        return localWorkflow;
    }

    private HashMap getConnections(List paramList) {
        HashMap localHashMap = new HashMap();
        Iterator localIterator = paramList.iterator();
        while (localIterator.hasNext()) {
            WORKFLOWLINK localWORKFLOWLINK = (WORKFLOWLINK) localIterator.next();
            String str1 = localWORKFLOWLINK.getFROMTASK();
            String str2 = localWORKFLOWLINK.getTOTASK();
            String str3 = localWORKFLOWLINK.getCONDITION();
            Object localObject = (List) localHashMap.get(str1);
            if (localObject == null) {
                localObject = new ArrayList();
                localHashMap.put(str1, localObject);
            }
            KeyValuePair localKeyValuePair = new KeyValuePair(str2, str3);
            ((List) localObject).add(localKeyValuePair);
        }
        return localHashMap;
    }

    private List getTasks(Workflow paramWorkflow, List paramList) {
        ArrayList localArrayList = new ArrayList();
        Iterator localIterator = paramList.iterator();
        while (localIterator.hasNext()) {
            KeyValuePair localKeyValuePair = (KeyValuePair) localIterator.next();
            String str = (String) localKeyValuePair.getKey();
            Task localTask = getTask(paramWorkflow, str);
            if (localTask != null) {
                localKeyValuePair.setKey(localTask);
                localArrayList.add(localKeyValuePair);
            }
        }
        return localArrayList;
    }

    private Task getTask(Workflow paramWorkflow, String paramString) {
        ArrayList localArrayList = new ArrayList();
        localArrayList.addAll(paramWorkflow.getTasks());
        localArrayList.addAll(paramWorkflow.getSessions());
        Iterator localIterator = localArrayList.iterator();
        while (localIterator.hasNext()) {
            Task localTask = (Task) localIterator.next();
            if (localTask.getName().equals(paramString)) {
                return localTask;
            }
        }
        return null;
    }

    private Folder readFolderElement(FOLDER paramFOLDER)
            throws RepoOperationException, UnsupportedTargetException, UnsupportedSourceException, UnsupportedTransformationException {
        Folder localFolder = XMLReaderHelper.getFolder(paramFOLDER);
        ArrayList localArrayList1 = new ArrayList();
        ArrayList localArrayList2 = new ArrayList();
        ArrayList localArrayList3 = new ArrayList();
        List localList = paramFOLDER.getFOLDERVERSIONOrCONFIGOrSCHEDULER();
        ListIterator localListIterator = localList.listIterator();
        while (localListIterator.hasNext()) {
            Object localObject1 = localListIterator.next();
            Object localObject2;
            Object localObject3;
            if ((localObject1 instanceof SOURCEImpl)) {
                localObject2 = (SOURCE) localObject1;System.out.println(((SOURCE) localObject1).getNAME());
                localObject3 = readSourceElement((SOURCE) localObject2);
                localFolder.addSource((Source) localObject3);
            } else if ((localObject1 instanceof TARGETImpl)) {
                localObject2 = (TARGET) localObject1;
                localObject3 = readTargetElement((TARGET) localObject2);
                localFolder.addTarget((Target) localObject3);
            } else if ((localObject1 instanceof TRANSFORMATIONImpl)) {
                localObject2 = (TRANSFORMATION) localObject1;
                localObject3 = readTransformationElement((TRANSFORMATION) localObject2);
                localFolder.addTransformation((Transformation) localObject3);
            } else if ((localObject1 instanceof SHORTCUTImpl)) {
                localObject2 = (SHORTCUT) localObject1;
                localObject3 = readShortCutElement((SHORTCUT) localObject2);
                localFolder.addShortCut((ShortCut) localObject3);
            } else if ((localObject1 instanceof MAPPLETImpl)) {
                localObject2 = (MAPPLET) localObject1;
                localObject3 = (Mapplet) readMappElement(localObject2, localFolder);
                localFolder.addMapplet((Mapplet) localObject3);
            } else if ((localObject1 instanceof MAPPINGImpl)) {
                localObject2 = (MAPPING) localObject1;
                localObject3 = (Mapping) readMappElement(localObject2, localFolder);
                localFolder.addMapping((Mapping) localObject3);
                localArrayList2.add(localObject3);
            } else if ((localObject1 instanceof CONFIGImpl)) {
                localArrayList3 = new ArrayList();
                localArrayList3.add((CONFIG) localObject1);
            } else if ((localObject1 instanceof SESSIONImpl)) {
                localObject2 = (SESSION) localObject1;
                localObject3 = readSessionElement((SESSION) localObject2, localArrayList2, localArrayList3);
                localArrayList1.add(localObject3);
            } else if ((localObject1 instanceof WORKFLOWImpl)) {
                localObject2 = (WORKFLOW) localObject1;
                localObject3 = null;
                try {
                    localObject3 = readWorkflowElement((WORKFLOW) localObject2, localArrayList2, localArrayList3);
                    ((Workflow) localObject3).addSessions(localArrayList1);
                    ((Workflow) localObject3).setParentFolder(localFolder);
                    localFolder.addWorkFlow((Workflow) localObject3);
                } catch (MapFwkReaderException localMapFwkReaderException) {
                    localMapFwkReaderException.printStackTrace();
                }
            }
        }
        return localFolder;
    }

    private PortType getEnumFromStrPortType(String paramString) {
        PortType localPortType;
        if (paramString.equals("GENERATED COLUMN ID/OUTPUT")) {
            localPortType = PortType.GENERATED_COLUMN_ID_OUTPUT;
        } else if (paramString.equals("GENERATED KEY/OUTPUT")) {
            localPortType = PortType.GENERATED_KEY_OUTPUT;
        } else if (paramString.equals("LOCAL VARIABLE")) {
            localPortType = PortType.LOCAL_VARIABLE;
        } else {
            localPortType = PortType.valueOf(paramString.replaceAll("/", "_"));
        }
        return localPortType;
    }
}

/* Location:           C:\Users\Rishav\Documents\NetBeansProjects\mapfwk\lib\jmf.jar
 * Qualified Name:     com.informatica.powercenter.sdk.mapfwk.xml.XMLReader
 * JD-Core Version:    0.6.2
 */
